Mixed-content inconsistent behavior, cannot find workaround #3993
Replies: 6 comments
-
Hello @michal-puczynski, Thanks for your inquiry. I've assigned your question to a dev that might best answer your question. @LiangTheDev, would you have any thoughts regarding this? Perhaps one of our colleagues? |
Beta Was this translation helpful? Give feedback.
-
I am not an expert on this. But I think that it is blocked due to mixed content, that is http resources are blocked in https pages. localhost is special as we know that it is local files and not subject to man in the middle attack, and it is often treated specially. CSP and mixed content check both has to pass before a sub resource can be loaded. You could try to use --unsafely-treat-insecure-origin-as-secure command line switch (in AdditionalBrowserArguments of CoreWebView2EnvironmentOptions) to specify the local network sites to treat them as secure. See more description of the command line switches at https://peter.sh/experiments/chromium-command-line-switches/. |
Beta Was this translation helpful? Give feedback.
-
How does it translate to API calls to WebView2 component? Is that something I can change from within .net MAUI application? |
Beta Was this translation helpful? Give feedback.
-
I don't know how MAUI uses WebView2, so can only give clues. Check https://stackoverflow.com/questions/67882953/disabling-of-web-security-when-using-webview2-in-c-sharp-coding-environment to see whether you can find the place to add similar code to your application. |
Beta Was this translation helpful? Give feedback.
-
This is interesting aspect. It works, for the moment only version with setting env before creating WebView. |
Beta Was this translation helpful? Give feedback.
-
This should be related to https://chromestatus.com/feature/4926989725073408. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am developing .net Blazor MAUI application that integrates with local network resources provided by HTTP, either as video stream or REST. The problem I am having that I can reach localhost over HTTP while I cannot reach any of local network resources, as the requested src is converted to HTTPS even though I use CSP.
Here is what I experience:
dotnet/maui#10141 (comment)
For the moment I do not know what am I dealing with, maybe a bug, maybe lack of knowledge.
Beta Was this translation helpful? Give feedback.
All reactions