-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OnBeforeBrowse method #354
Add OnBeforeBrowse method #354
Conversation
As it stands I've added the OnBeforeNavigation method to IRequestHandler, it seemed like a logical place for it, anyone have a suggestion of a better place for it? |
It seems that the cefCore does not implement the handler callback:( |
It would appear that OnBeforeNavigation will eventually be removed and has been flagged as deprecated. See https://code.google.com/p/chromiumembedded/issues/detail?id=1076
|
I need a way to cancel the navigation if the url matches a predefined condition. Example: a page has a few internal links and 1 link pointing to www.yahoo.com. When user clicks the yahoo link, I don't want user to navigate to yahoo. Instead, I want to pop up a message box and then cancel the navigation. I did this with IE based web browser control. But want to migrate to CEF3. |
I've created a quick example of this using the WinForms Example, it will be almost identical with WPF. The code is in this branch https://github.com/amaitland/CefSharp/tree/example/onbeforebrowse Give that a go and let me know |
…though looks like it will be deprecated shortly. For now use OnBeforeBrowse
thanks! It works! |
When will this become available in main trunk? Thanks, Jerry |
@jerrymats If you ask @jornh very nicely he might be able to review the changes when he has a spare moment. @jornh I've rebased the changes so hopefully Auto-Merge is an option. |
Yes it is. I had my coffee now - so I'll dare merging this from the couch 😉 based on Jerry's checking ... @jerrymats and @hszeng thanks for giving input/feedback on this one it helps immensely ... And welcome to CefSharp BTW if you haven't been around before! Closes #353 |
@jornh I though you might appreciate the Xml comments 😄 |
I second @jornh's appreciation here - thanks a lot! We should definitely strive for getting all the public parts of |
@perlun Happy to help 😄 |
The main update only thing it might need is maybe something close to the class description of http://magpcss.org/ceforum/apidocs3/projects/(default)/CefBrowser.html (if the same rules apply, I haven't investigated that - yet - though of course for Wpf/WinForms it's more or less implied where they live). Don't know if you guys are familiar with http://www.nudoq.org? See http://www.nudoq.org/#!/Packages/Autofac/Autofac/IContainer for an example which even has Their own tag-line is:
Top points for me is:
I think all it would take for us to have a documentation presence there would be:
Thoughts? |
👍 from my end! Looks really promising. |
Exposed CEF3 functionality for
OnBeforeNavigation(is deprecated in CEF) and OnBeforeBrowse