|
Rank: Advanced Member Groups: Member
Joined: 4/6/2015 Posts: 33
|
We are now getting a CORS error when trying to load a a file from disk.
Access to XMLHttpRequest at 'file:///C:/changed/for/security/BIN/DEBUG/ourfile.PDF' from origin 'http://bnimble.bnimble' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.
We are using EO.WebBrowser 21.2.70.0.
This worked with EO.WebBrowser 19.1.40.0.
We are setting EnableWebSecurity False.
' Disable Cross Origin loading for the WebView ' Note: Can also be disabled for the Engine as a whole or for the entire App Dim options As New EO.WebEngine.BrowserOptions() options.EnableWebSecurity = False WebView1.SetOptions(options)
We have also tried:
WebView1.Engine.Options.ExtraCommandLineArgs = "--Access-Control-Allow-Origin"
Thanks, David
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, Please try this:
Code: C#
EO.WebEngine.EngineOptions.Default.ExtraCommandLineArgs = "--disable-web-security";
This is a global setting that must be set before you use any WebView. So for example, if you use Windows.Forms, then you can set it in your Main method before you creating your main form. This should disable CORS entirely. They way you set it won't work because it is set after the WebView has been created. BrowserOptions.EnableWebSecurity won't work either because it is per WebView. CORS can only be turned off globally from command line. Hope this helps. Please let us know if it works for you. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 4/6/2015 Posts: 33
|
We tried the following, as the first call to EO and after the License call. No success. EO.WebEngine.EngineOptions.Default.ExtraCommandLineArgs = "--disable-web-security --Access-Control-Allow-Origin"
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, In that case please try to isolate the problem into a test project and send the test project to us. See here for more details: https://www.essentialobjects.com/forum/test_project.aspxOnce we have the test project, we will debug into the source code here and see what we can find. Thanks!
|
|