Page 1 of 1

How to disable cross origin security

Posted: Sun May 16, 2021 4:16 am
by tad.chen
I want to disable cross origin security in some TChromium instances of browser, but enable cross origin security in other TChromium instances.

Is it possible?

I set chrmosr.Options.WebSecurity to STATE_DISABLED in those TChromium instances which I want to disable cross origin security. But it doesn't work!

I use an old CEF4Delphi version, maybe a new version can work. If that, which version supports it?

Re: How to disable cross origin security

Posted: Mon May 17, 2021 12:55 pm
by salvadordf
The WebSecurity browser preference was removed by CEF in this commit :
https://bitbucket.org/chromiumembedded/cef/commits/35a360fe66d1e85584866f23daf452fcd36c090b

That commit fixed this issue :
https://bitbucket.org/chromiumembedded/cef/issues/3058/remove-cefbrowsersettingsweb_security

Apparently Chromium changed internally and that setting was not very useful any longer so the CEF project maintainer removed it. Read the comments in the last link for more information.

I'm not aware of any way to disable cors on an individual browser. At this moment you can set GlobalCEFApp.DisableWebSecurity to true to disable it in all the browsers.

Re: How to disable cross origin security

Posted: Mon May 17, 2021 1:05 pm
by tad.chen
I see. Thank you for your information.