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
Support for manually specifying command line args via ::OnCommandLineProcessing #365
Conversation
…om within the app and be processed by cef (used OnBeforeCommandLineProcessing for implementation)
@@ -13,16 +13,50 @@ namespace CefSharp | |||
class CefSharpApp : public CefApp | |||
{ | |||
gcroot<CefSettings^> _cefSettings; | |||
gcroot<IDictionary<String^, String^>^> _cefCommandLineArgs; |
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 am new to c++/cli, did look up gcnew and gcroot but i am unsure if this is right
to add proxy settings you could do this: var commandLineArgs = new Dictionary<string, string> |
nicely done i will try that out on monday with our corporate proxy. i think it would be cleaner if the Dictionary was added as property to the cefsettings. |
ok, i will change this as soon as possible. |
i think that all/most of the other properties of CefSettings.h are "forwarded" to a native struct/a type wrapper from the cef.sdk. I don't know how i should add command line args there. Or is it enough to stay at the clr side and not forward these to the struct? I think i have to look closer at the code. At the moment i do not understand what is happening there. |
just stay at the clr side at use it where u need it |
did update my pr and did incorporate command line args into CefSettings |
@Timobile Adding CommandLineArgs to |
Perhaps it's worth posting an updated usage example? |
sure, here it is:
right now you can not specify a whole dictionary to be used as CefCommandLineArgs. Should i add a setter for CefCommandLineArgs? Then it would look like above and additionally it would be possible to add many arguments like this:
|
@Timobile I don't really mind one way or another, so see what other people have as a preference. As it stands it's consistent with cefCustomSchemes. |
yes, this was my intention when not adding the setter, but perhaps it is more convenient for the user to be able to use both possibilities? And probably you will add more than one commandLineArg at once. With schemes this is not the case i think (but i did never use them i have to admit). |
@@ -1,4 +1,4 @@ | |||
// Copyright � 2010-2014 The CefSharp Authors. All rights reserved. | |||
// Copyright � 2010-2014 The CefSharp Authors. All rights reserved. |
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.
Copyright symbol has become garbled, will need to fix at some stage.
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.
@amaitland @perlun I'm thinking we should just replace the ©️ symbol with a (c)
at some point even tough they look nice when they are not broken. They seem to break all the time. I think we can use our and others time better on something else. Agree?
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.
Yep, works for me!
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.
It's a shame we still fight the ASCII monster these days... Do you have any clue why it breaks? Is it the GitHub web UI that causes it? I think Visual Studio should be UTF8-safe.
Sent from my iPhone
On 30 maj 2014, at 10:40, "jornh" <notifications@github.commailto:notifications@github.com> wrote:
In CefSharp.Core/Internals/CefSharpApp.h:
@@ -1,4 +1,4 @@
-// Copyright ? 2010-2014 The CefSharp Authors. All rights reserved.
+// Copyright ? 2010-2014 The CefSharp Authors. All rights reserved.
@amaitlandhttps://github.com/amaitland @perlunhttps://github.com/perlun I'm thinking we should just replace the [:copyright:] symbol with a (c) at some point even tough they look nice when they are not broken. They seem to break all the time. I think we can use our and others time better on something else. Agree?
Reply to this email directly or view it on GitHubhttps://github.com//pull/365/files#r13219264.
No I think it's good! Please go ahead and do the merge. @Timobile a VERY well done and useful first contribution 😄 Happy to see more from your side, Vielen Dank! |
Support for manually specifying command line args via ::OnCommandLineProcessing
@jornh I've fixed those two small things on |
When I think about it, we probably don't want to set "user-agent" to "me" in either of the examples, so I've commented that out and added a comment to serve as a usage example for the short term. |
Good minor tweaks, @amaitland remember to close #239 (for people who listen to that one) with a reference to this PR and add a line to the ChangeLog (for everyone) - if you didn't already. |
wow, cool, this got merged! The thing with the garbled copyright could realy been done by the web frontend at github. Changed something there and after that the update/push became 'difficult'. I think i did overlook this problem. @jornh thanks for the encouragement, Gern' geschehen :-) |
No worries, family expansions always comes higher in on the list than Pull Request in CefSharp-land. Big congrats on the new 🚼 |
@Timobile Congrats on the new 🚼 Thanks again for the contribution! |
@Timobile if i wanted to pass in a named proxy using your settings, how would I do it? for example if my network proxy is but it does not work the way i expect. |
Try skipping the |
@kropewnicki: yes, @jornh should be right. My Example above is
In your case try
or
but be aware that my experience with handling of an (ntlm) authenticating proxy in the current version is that it does not work. Maybe it works if no ntlm authentication is required. I wrote some lines about it here #239 . If you get this working somehow, please leave a comment here or in #239 so i can try it with my setup too. |
I am back to working on a CEFsharp solution for my project; Thanks for adding this feature. I still get an exception when running in VS2010 debugger that stops me from running/testing/debugging the app that way. Maybe not related to this??? I thought it was. I even tried attaching the VS debugger to the app, and it ran fine until attaching the debugger. Same exception. (An event was unable to invoke any of the subscribers. Error Number 0x80040201) |
Looks like the issue I'm seeing is related to this ... https://connect.microsoft.com/VisualStudio/feedback/details/538649/system-runtime-interopservices-co |
OK. Found the solution for my issue. Found this info posted in 2010 about VS2010 ... |
Another reason why we should perhaps drop VS2010 I guess. 😉 As has been discussed in #381 recently. 😛 |
OnBeforeCommandLineProcessing
#239