-
-
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
Added CefRequestHandler.OnBeforePluginLoad #318
Conversation
@fraenke75 regarding the code I'd say this looks like a really good contribution. There are a few issues with whitespace which should be easy to spot if you look at https://github.com/cefsharp/CefSharp/pull/318/commits ah I mean https://github.com/cefsharp/CefSharp/pull/318/files. To have those pages look good we use spaces and not tabs. I'll point to a few of them inline. You can just fix it in a followup commit and push that to your |
{ | ||
namespace Internals | ||
{ | ||
String^ CefWebPluginInfoWrapper::Description::get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace problem
@jornh: You are right. I usually program in C# and have the VS-setting to use spaces and not tabs there. Unfortunately I missed to set this for C++ too :-) |
Sorry wrong usage of GitHub. Reopened again. |
Ahh yes ... everyone starting to make PR's seems to stumble on that one. Should really stand out in https://github.com/cefsharp/CefSharp/blob/master/CONTRIBUTING.md ... I guess PR's for that one is welcome too 😄 - as is stands now you are really met by a "wall of text" so its hard to find the important bit's in there. I know @amaitland did too Maybe clear sections for people 'just' reporting issues and people submitting PR's would help?
LOL ... you can only learn by pulling some of the handles eh? |
My time is currently rather low (who's not?), but I will try to keep on supporting CEFSharp. I have already seen some handlers which I will implement. |
@@ -49,10 +49,10 @@ public static void Init() | |||
private readonly IWebBrowser model; | |||
private readonly Action<Action> uiThreadInvoke; | |||
|
|||
public ExamplePresenter(IWebBrowser model, Action<Action> uiThreadInvoke) | |||
public ExamplePresenter(IWebBrowser model) //, Action<Action> uiThreadInvoke) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code I do not like... 😄
Could you please add a small usage example description either as this: #342 (comment) or for added bonus even as an example one can invoke from the menu of either the Wpf or WinForms example? Sorry for moving the entry bar a bit up here 😄 but in in the long run it will benefit everybody in getting to know CefSharp! |
Usage: Create a Presenter class which inherits from IIRequestHandler
In ViewModel (or anywhere else) where Webbrowser is loaded attach the Presenter class to the Webbrowser instance:
Hope this helps. |
It certainly does thank you very much! In return I'll take it on my shoulders to merge in |
Added CefRequestHandler.OnBeforePluginLoad
Uh-ooh, that didn't turn out as planned! I somehow ended up committing my manual merge plus a few minor fixes directly to @perlun do you have any suggestions on what I should do here? I of courses wanted @fraenke75's PR to be part of it. I think I have done one of these manual merges successfully in SourceTree/terminal before ... but this one for some reason said this
I'm really sorry guys! I tried my best 😢 |
Don't worry Jørn! I stripped away your changesets (by using the
So, you can now retry the merge & manual fixes etc. |
Cool thanks mate! I'd hate having mess in master because of me. Will have another careful go at it - but not today. Better cool down a bit |
@jornh Did you make any progress with this? Any chance you could post a quick HOWTO when you've got it sorted? Is it as simple as merge the PR into local master, resolve conflicts, commit, then push? |
@@ -71,6 +71,7 @@ namespace CefSharp | |||
virtual DECL bool OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request) OVERRIDE; | |||
virtual DECL bool GetAuthCredentials(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, bool isProxy, | |||
const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr<CefAuthCallback> callback) OVERRIDE; | |||
virtual bool OnBeforePluginLoad( CefRefPtr< CefBrowser > browser, const CefString& url, const CefString& policy_url, CefRefPtr< CefWebPluginInfo > info ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed this was slightly inconsistent, should it be this below?
virtual DECL bool OnBeforePluginLoad(CefRefPtr<CefBrowser> browser, const CefString& url, const CefString& policy_url, CefRefPtr<CefWebPluginInfo> info) OVERRIDE;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed that during my review here: jornh@7265a0d#diff-7bb59914aa140dd1e2255adc0b82c204R86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! 😄
Yes, like the last 3 commits in this? https://github.com/jornh/CefSharp/compare/fraenke75-RequestHandlers One thing I would like both of you @fraenke75 and @amaitland to review is that I changed the meaning of the bool return value to the opposite (but that's what my testing - and the CEF API docs suggested) |
@fraenke75 I submitted the merge and my two change commits as a PR towards your branch: fraenke75#1 I newer tried it this way around before (I'm still now to git/GitHub too 😄) but with a bit of luck it should add it to your branch just by pushing the green merge button AND this #318 PR and we should get a green merge button too |
@jornh That's consistent with other functions exposed via I can run it to double check if you'd like? Though I'm sure it works as advertised 😄 |
Yes I noted that too like CEF says "return false in your handler if you don't want to change my default" @ You're welcome to take it for a spin. Or sit tight and give @fraenke75 a bit of time to look at it. |
Will take it for a spin and let you know 😄 |
@jornh Works exactly as advertised! |
@amaitland I'll take that together with your comments on other issues that you are waiting for #318 as a vote to merge #318 plus my additions in fraenke75#1 now 😄 Thanks for giving it an extra set of eyes! |
Awesome! The list grows smaller! 😄 @jornh Was there a secret to merging so that github recognised this PR? |
Ahem ashamed to say it, but I'd better let it out, I think the problem was: "When following the recipe below - make sure you actually commit (at the right point) after manual resolution of the merge conflicts" 😝 Good thing @perlun knew where to find the brakes!
Anyway @fraenke75 thanks a bunch for your good contribution 👍 much appreciated! Happy to see more if you find another pet project. I'll close the PR towards your fork in a few days ... feel free to experiment with it otherwise. |
Added the missing method implementation for CefRequestHandler.OnBeforePluginLoad. Extended the IRequestHandler interface.