ElectronicObserverEN / ElectronicObserver

Electronic Observer is a game viewer for Kantai Collection.
Other
84 stars 20 forks source link

Webview2 doesn't load game after refreshing #438

Closed Heinrike closed 9 months ago

Heinrike commented 9 months ago

The game loads normally when EO starts up, but no longer loads after refreshing. The game can be made to load normally by using "Go to _Login Page" instead or by restarting EO.

When the page fails to load, the devtools console displays a few errors saying "Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure script ''. This request has been blocked, the content must be served over HTTPS."

Turning "HTTPS" on or off in settings/subwindow/browser does not seem to change this. Cefsharp also does not have this problem, regardless of the HTTPS setting either.

Not sure if it makes a difference, but I'm on windows 10

Heinrike commented 9 months ago

I think this happens because on startup or when redirecting from the login page, Webview2 loads the http:// version of the game url, but when refreshing, it goes to https:// instead. Even when on the https page, connecting to the game servers is done through http regardless, which Webview2 will block as mixed content.

Unlike Webview2, Cefsharp will stay on http after refreshing. This bug might be fixed if Webview2 is made to behave the same way

myangelkamikaze commented 9 months ago

Yeah, looks like WebView2 does an HTTPS redirect, so the same thing devs mentioned for people using regular browsers. Thanks for the detailed report!