|
Rank: Newbie Groups: Member
Joined: 1/16/2019 Posts: 2
|
Hello, I am trying to send an XMLHttpRequest via EvalScript. I am sending the request to a website on HTTP, while on a website that uses HTTPS. I have set EnableWebSecurity and EnableXSSAuditor too false. NOTE: I have ran this exact javascript code in Google Chrome DevTools Console and it works perfectly fine without any errors.I am getting the following error in the WebView DevTools Console:Mixed Content: The page at 'https://www.google.com was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://localhost:3000/'. This request has been blocked; the content must be served over HTTPS.My JavaScript Code:
Code: JavaScript
var xhttp = new XMLHttpRequest();
xhttp.open('POST', 'http://localhost:3000/', true);
xhttp.setRequestHeader('Content-Type', 'application/json');
xhttp.send({});
My C# Code for WebView initialization:
Code: C#
var options = new BrowserOptions
{
LoadImages = false,
EnableWebSecurity = false,
EnableXSSAuditor = false
};
var threadRunner = new ThreadRunner("viewThread");
var webView = threadRunner.CreateWebView(options);
If someone could inform me what settings I am missing too make this work that would be great. The JavaScript code works in Google Chrome so I must be missing a setting for the WebView too enable this type of behavior. Thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, There is no settings that controls directly through API with EO.WebBrowser. Google Chrome does have a command line option "--allow-running-insecure-content" that supposes to control this but we have not verified it. You can try to set it and see if it works. To set Chromium engine's command line arguments with EO.WebBrowser, you would need to set this property: https://www.essentialobjects.com/doc/eo.webengine.engineoptions.extracommandlineargs.aspxSee here for how to set engine options: https://www.essentialobjects.com/doc/webbrowser/advanced/engine.aspxNote that we do not support all Chromium engine options, this is often the case for options that are linked to user profiles since we do not have user profiles. So there is a chance that this may not work. If that case please let us know and we will double check on our end. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 1/16/2019 Posts: 2
|
Hello,
"--allow-running-insecure-content" has fixed the issue, thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Great. Thanks for confirming that it works!
|
|