Tintin
Tintin

Reputation: 2983

Cross domain requests in CEFSHARP

I am using a custom scheme to inject my html/js in the CEFSHAP chromium and it is working fine. But now inside some of the js files I am making XmlHttpRequest to other domains - but these requests are not going through because of the cross origin issues.

I tried:

        CefSharp.BrowserSettings browser_setting = new CefSharp.BrowserSettings();
        browser_setting.WebSecurityDisabled = true;
        browser.BrowserSettings = browser_setting;

but that didnt help!

Outside the CEFSHAP if I run the same html/js in normal browser it works fine if I add a command line switch --disable-web-security.

Thanks

Upvotes: 0

Views: 8431

Answers (1)

Czarek Tomczak
Czarek Tomczak

Reputation: 20675

In CEF you could either add the cross-origin header "Access-Control-Allow-Origin: *" to the response in RequestHandler . Or provide the "disable-web-security" flag programmatically in OnBeforeCommandLineProcessing callback.

Upvotes: 3

Related Questions