Closed jasonJamEther closed 5 years ago
load local html sites.
This is too vague. Please explain which method(s) you are calling.
This doesn't appear to be allowed.
Explain "allowed" What happens, does it strip off the query string?
It's better to provide full reproducible steps with expected and actual result.
It's likely that whatever you are trying to do is not permitted by the MS WebView.
I am sorry that I didn't explain better. I simply want to load a local file with some url parameters. file://myfile.html?myparam=1
for example - windowsWebView.loadFileURL(localFile.nativePath + "?customSlideOrder=5",localFile.parent.nativePath);
Trying to do this, the webview just loads an empty white page.
If I have a local file without any url parameters it works great. But even if I click a link inside that webpage that then points to another local file url <a href="example.html?test=1">test</a>
that has GET variables, that link won't work and instead the page remains as if nothing had been clicked.
I am hoping there is a simple way around this or a simple call that I am missing. Thank you for your time on this great ANE.
I'm afraid querystring params won't work in the Edge version for local files (and result in an error too). Edge uses a file stream to load in files. It sees the ?test=1 as part of the file name and then says it can't find that file.
There is no way to change this. Edge component is less rich than Chromium. The only solution is to either use Chrome WebView or run your local site on a locally running webserver. You can package nginx.exe and start it using NativeProcoess. https://nginx.org/en/docs/windows.html
Loading local files via file calls should not be used for complex websites as you will eventually hit problems such as CORS.
[trace] ms-local-stream://Microsoft.Win32WebViewHost_cw5n1h2txyewy_4c6f63616c436f6e74656e74/localTest.html?param=1 [trace] 18 [trace] UnexpectedStatusCode
You could try setting localStorage or a cookie via webView.evaluateJavascript
to save the variable, that could get round it.
Thank you for your help. I will try some of your recommended solutions.
I am using windows edge to load local html sites. Everything works well until I try adding some GET parameters to my url (?param1=1). This doesn't appear to be allowed. Is there another way to handle this?