webview_csharp icon indicating copy to clipboard operation
webview_csharp copied to clipboard

Only working on canary

Open MitchellMonaghan opened this issue 3 years ago • 16 comments

Hi I'm pretty sure I tested this a few weeks ago using edge 86.0.622.51 and I thought it worked just fine. Since then I seem to only be able to get this to run on edge canary.

Currently using the newest edge Version 86.0.622.61 (Official build) (64-bit) and cant seem to get it working. It opens a window but behaves like it failed to instantiate the webview.

Thank your for your help and maintaining c# bindings for this.

MitchellMonaghan avatar Nov 02 '20 23:11 MitchellMonaghan

Hey! If a non valid Edge Chromium version is present on the current system, webview will fallback to the old Edge. Therefore you should never get a blank window. Only difference should be the used browser engine. May I ask what you mean with "behaves like it failed to instantiate the webview"?

geaz avatar Nov 03 '20 06:11 geaz

it opens the window, but there doesn't seem to be a webview. On right click there is no context menu, F5(refresh), F12(dev tools) seem to have no effect.

Just a blank white window, no exceptions or errors seem to be thrown either. Was able to reproduce the issue on 3 separate machines.

MitchellMonaghan avatar Nov 03 '20 08:11 MitchellMonaghan

Could you please test, if the minimal example is working for you.

geaz avatar Nov 04 '20 12:11 geaz

Just tested, the minimal example did work. So something else is going on. I had tried to create my own minimal example and encounter the same issue so it think its something in my project or build.

MitchellMonaghan avatar Nov 04 '20 16:11 MitchellMonaghan

It seems to specifically break when I use http://localhost:8080

MitchellMonaghan avatar Nov 04 '20 16:11 MitchellMonaghan

Please execute the following in admin command prompt and try again:

CheckNetIsolation.exe LoopbackExempt -a -n="Microsoft.Win32WebViewHost_cw5n1h2txyewy"

geaz avatar Nov 04 '20 16:11 geaz

Still seems to be broken after running that command. Also I can reproduce it in the minimal example just by changing the url to http://localhost:8080

MitchellMonaghan avatar Nov 04 '20 16:11 MitchellMonaghan

Do you have something running on http://localhost:8080? Just changing the URL to localhost in the minimal example will not automatically host a webserver. If you want the application to host its content you have to use a HostedContent like in the DesktopApp example.

geaz avatar Nov 04 '20 16:11 geaz

Yes I am using localhost for development to support hot reloading, but even if my local webserver wasn't running edge normally servers a page not found screen with a refresh button. This window behaves like there is no webview at all.

MitchellMonaghan avatar Nov 04 '20 17:11 MitchellMonaghan

Did you check, if the DesktopApp example works? If not, it sounds like there is still a problem with the loopback. If the above command was not working for you, you also could check the loopback settings with this gui manager: https://github.com/tiagonmas/Windows-Loopback-Exemption-Manager

geaz avatar Nov 04 '20 20:11 geaz

Hi so I'm not sure what happened maybe I gave you false feeback. It randomly started working on my machine I'm not sure what exactly happened or when it started working. Was trying to fix this in between other work issues.

I checked with a coworker that it was still broken on his machine, had him run your command and then it was working on his machine. So I assume running the command is what fixed it on mine but I'm not sure why it didn't work right away.

MitchellMonaghan avatar Nov 04 '20 22:11 MitchellMonaghan

Is this something that should be documented in the readme? I assume most people will develop on localhost as they build their web ui. Thanks so much for your help investigating this with me, I really appreciate it

MitchellMonaghan avatar Nov 04 '20 22:11 MitchellMonaghan

Also it would be nice if the window gave more feed back as to what the issue was if thats possible. Right now it just looked like it failed to create the webview.

MitchellMonaghan avatar Nov 04 '20 22:11 MitchellMonaghan

No problem. The problem with the localhost is already documented in the readme.

But yes, maybe it is possible to check, if the command ran successfully and to give feedback. Good idea! :)

geaz avatar Nov 05 '20 04:11 geaz

Oh sorry I didn't see that section...and I read the documentation multiple times...haha. Might be good to slightly change the text to include "localhost" vs loop back for dummies like me.

Thanks

MitchellMonaghan avatar Nov 06 '20 14:11 MitchellMonaghan

Implemented a check. If loopback is not enabled on windows, the library will now show a message.

grafik

Have to test, if everthing is still running fine on linux. Will release a new version including this feature soon.

geaz avatar Nov 07 '20 15:11 geaz

Closed by #13

geaz avatar Feb 10 '23 11:02 geaz