MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
454 stars 55 forks source link

Web Workers API doesn't work #2296

Open vchirikov opened 2 years ago

vchirikov commented 2 years ago

Description

Web Workers API instead of sources of a file gets source of the index.html. I mean fetch() returns right file, but new Worker() doesn't. Check the screenshots and gif. Is it a webview2 bug or a buf inside of maui wrapper of the webview2?

bug

Version SDK: Runtime: 99.0.1150.46 Framework: MAUI OS: win11 / android / any (?)

Repro Steps

image

image

cc: @champnic

AB#38653528

champnic commented 2 years ago

Hey @vchirikov - thanks for the bug report, and sorry you are hitting this! Do you see the correct behavior if you run this in the Microsoft Edge browser, or another WebView2 app?

vchirikov commented 2 years ago

Do you see the correct behavior if you run this in the Microsoft Edge browser

yes, in MS Edge everything is ok

vchirikov commented 2 years ago

it's strange, if I use <Content Include="..\UI.Blazor.Host\wwwroot\**\*.*" Link="wwwroot\%(RecursiveDir)%(Filename)%(Extension)" /> in csproj, the files will be copied, but the new Worker() doesn't work. If I copy files into wwwroot in the maui project directly it will work (except serviceWorker api?).

Hm..

champnic commented 2 years ago

Thanks for confirming - I've added this bug to our backlog to take a closer look. Is this blocking you, or do you have workarounds for now?

vchirikov commented 2 years ago

https://github.com/dotnet/maui/blob/main/src/BlazorWebView/src/Maui/Windows/WinUIWebViewManager.cs#L56-L59

Looks like MAUI issue.. Can you move the issue to their repo?