Disable/enable web security *after* CEF initialization

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Disable/enable web security *after* CEF initialization

Postby callum » Fri Nov 10, 2017 3:35 pm

My embedded web app needs to load images locally so I disable web security by injecting the command line option:

Code: Select all
 command_line->AppendSwitch("--disable-web-security");


That works well but I would like to be able to selectively enable/disable it after CEF is initialized.

Is there a way to do that or alternatively, is there a different switch that would let my HTML/JS load local images but not open up everything else that disabling web security gives you?
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm

Re: Disable/enable web security *after* CEF initialization

Postby magreenblatt » Fri Nov 10, 2017 4:44 pm

You should load your images using a custom scheme handler. Then you don't need to disable web security. See https://bitbucket.org/chromiumembedded/ ... t-handling
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: Disable/enable web security *after* CEF initialization

Postby callum » Fri Nov 10, 2017 4:48 pm

Fantastic - looks exactly like what I am looking for.

Thanks Matt.
callum
Expert
 
Posts: 323
Joined: Mon Feb 23, 2015 6:19 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 47 guests