how to add command line switches in chrome in CEFSHARP

3,814 views
Skip to first unread message

Aurora

unread,
Dec 18, 2014, 11:23:03 AM12/18/14
to cefs...@googlegroups.com
How can I add command line switches e..g --allow-external-pages --disable-web-security  etc
I know some of these could be handled by using changing BrowserSettings but there the scope is pretty limited.  

There are lot of of the other command line switches http://peter.sh/experiments/chromium-command-line-switches/

Is there a generic way of doing that?

Thanks

Samir Boulema

unread,
Jul 8, 2015, 9:59:37 AM7/8/15
to cefs...@googlegroups.com
This should work:

if (!Cef.IsInitialized)
{
  var cefSettings = new CefSettings();
  cefSettings.CefCommandLineArgs.Add("disable-web-security", "disable-web-security");
  Cef.Initialize(cefSettings);

Alex Maitland

unread,
Jul 8, 2015, 6:22:15 PM7/8/15
to cefs...@googlegroups.com
More examples https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Example/CefExample.cs#L37

It can be useful to load `chrome://version` in the browser to see which command line arguments were used.
Reply all
Reply to author
Forward
0 new messages