You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Problem/Bug]: Recent WebView2 runtime update causes WebView2 session to freeze for 15 seconds #4514
A recent update to the WebView2 runtime is causing a WebView2 session in my app to become inoperable at a specific stage of being in use. This takes place when my WinUI 3 app opens a WebView2 session (for my web app). I first noticed this with runtime version 124.0.2478.67, but it could be possible that the regression was first introduced with runtime version 124.0.2478.51. This is not reproduceable in the Edge app, only the runtime. The following video demonstrates the regression, causing a freeze in my web app for 15 seconds:
safesurfer-webview2-regression.mov
The next time I open the app and try again, the same freeze has a duration of only two seconds. The following video demonstrates the same process with no freezing, as per runtime version 123.0.2420.65:
safesurfer-webview2-working.mov
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
124.0.2478.67
SDK Version
1.0.2210.55
Framework
WinUI3/WinAppSDK
Operating System
Windows 10, Windows 11
OS Version
22631.3447
Repro steps
(Please see videos.)
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
var env = await CoreWebView2Environment.CreateAsync(null, path, null);
await webView.EnsureCoreWebView2Async(env);
and it creates wv2 without delays.
With your repro do you see the same freeze as reported for 15 seconds and it started to happen with 124.0.2478.x?
Which line of your code causes delay for you?
Do you have any env vars or registry keys which affect the logic of which runtime wv2 runtime is used, do you have any prerelease channels installed?
The delay doesn't happen in the code it happens when using the webview, I've done some experimenting tonight and seems that it is because I am changing the user folder if I pass null I get no delays. It seems to happen on the 2nd navigation (1st navigation is load the log in page, 2nd is log in or fail to login) but doesn't happen every time, the page starts to load but there is a delay before it fully loads.
The delay happened after loading.gif in this network log
There is nothing in the crashpad, I enabled chronium logging but it doesn't seem to be useful, I have tried it on 3 different computers all showing similar results and I am not sure about other webview versions as I have only started this project, I have only used the newest version I can try an older one though. I haven't been working with webview2 for very long so I don't have any prerelease versions installed or any reg/keys or enviroment vars.
I haven't been able to get a consistant situation where it freezes for a long period but I have one where it will freeze everytime, sometimes for 1 second and sometimes for 15+ seconds on the github login screen. The freeze only happens once per application run, if you go back and try again there is no freeze(queueing) at all.
The freeze in this case is always between the collect and stats requests in that screen shot, similar to how its always between the same 2 requests on mine. SampleApp.zip
We're having the same issue and we suspect it's due to a runtime update. In webview2 Runtime 123.0.2420.97 version is normal, after updating to 124.0.2478.67 version started to freeze on first login (we used 22 seconds). The latest webview2 Runtime version is 125.0.2535.51. The same problem occurs after verification.
We can not repro the issue - but we got the traces, thank you Colm Canavan (@ichijikuibo). It looks like there should be dump file also generated in <UDF>\EBWebView\Crashpad\reports\ (more about dumps). If somebody who is reproing it and have a dump - could you please let us know
I haven't got anything in that folder have you tried changing the userdata folder? Changing it defiantly makes the problem worse which is why in that screenshot I am on WebViewuserfolder3 in the origional issue I noticed I was loading multiple tabs with all with different userdata folders to isolate the cookies so userdata folder being different than what it was the last time webview was run could be a factor.
That looks to be working now but I will try a bit more tomorrow I spent too long trying to get it to switch to canary before finally changing the folder in application.
vbryh-msft Thanks for the update. Apologies for our delay in reply, as we haven't had time to debug further. Could you please reply with steps on how to install (or apply) the Canary version of WebView2? I can't seem to find a Canary WebView2 runtime binary, only stable ones.
vbryh-msft I've created a wildcard DWORD value under HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2\ChannelSearchKind and set it to 1, installed the Canary version of Edge, uninstalled my app, restarted my workstation, rebuilt my app, and checked the DevTools console with navigator.appVersion, but it prints out 125.0.0.0. Am I missing something? I presume that my app isn't seeing a Canary runtime and is using the stable version instead, as per the documentation.
After further attempts, I couldn't get my WebView2 session to change channel. Regardless, I've tested again on the latest WebView2 runtime (126.0.2592.81) on a few devices, and the issue looks to be resolved now. Thanks again for your help!
Kirwan Smith (@kirwan-safesurfer) - we added short doc how to easy test fixes/try new features in Canary - if it does not work for you and you want us help to debug - feel free to open new issue about that. Thanks
Activity
vbryh-msft commentedon Apr 30, 2024
ichijikuibo commentedon May 13, 2024
I appear to have the same problem and have found that is related to how I am initialising the Webview.
When I do a standard initiation not using CreateWithOptionsAsync the problem doesn't happen.
I haven't tried any other combination yet, such as passing valid values as parameters 1 and 3 instead of null etc but I will.
vbryh-msft commentedon May 14, 2024
Colm Canavan (@ichijikuibo) I have tried to create wv2 in our .net sample app with:
and it creates wv2 without delays.
With your repro do you see the same freeze as reported for 15 seconds and it started to happen with 124.0.2478.x?
Which line of your code causes delay for you?
Do you have any env vars or registry keys which affect the logic of which runtime wv2 runtime is used, do you have any prerelease channels installed?
ichijikuibo commentedon May 14, 2024
The delay doesn't happen in the code it happens when using the webview, I've done some experimenting tonight and seems that it is because I am changing the user folder if I pass null I get no delays. It seems to happen on the 2nd navigation (1st navigation is load the log in page, 2nd is log in or fail to login) but doesn't happen every time, the page starts to load but there is a delay before it fully loads.
The delay happened after loading.gif in this network log
There is nothing in the crashpad, I enabled chronium logging but it doesn't seem to be useful, I have tried it on 3 different computers all showing similar results and I am not sure about other webview versions as I have only started this project, I have only used the newest version I can try an older one though. I haven't been working with webview2 for very long so I don't have any prerelease versions installed or any reg/keys or enviroment vars.
Log files
freeze at 215451.txt
no freeze.txt
I will try find a public site tomorrow that has the same behaviour and make a sample project if I can.
ichijikuibo commentedon May 15, 2024
I haven't been able to get a consistant situation where it freezes for a long period but I have one where it will freeze everytime, sometimes for 1 second and sometimes for 15+ seconds on the github login screen. The freeze only happens once per application run, if you go back and try again there is no freeze(queueing) at all.
The freeze in this case is always between the collect and stats requests in that screen shot, similar to how its always between the same 2 requests on mine.
SampleApp.zip
wanghan123 commentedon May 22, 2024
我们也遇到了同样的问题,我们怀疑是运行时更新导致的。在webview2 Runtime 123.0.2420.97版本正常,更新到124.0.2478.67版本开始出现首次登录卡顿(我们使用了22秒)。最新版webview2 Runtime 版本号125.0.2535.51经过验还是存在同样的问题
We're having the same issue and we suspect it's due to a runtime update. In webview2 Runtime 123.0.2420.97 version is normal, after updating to 124.0.2478.67 version started to freeze on first login (we used 22 seconds). The latest webview2 Runtime version is 125.0.2535.51. The same problem occurs after verification.
wanghan123 commentedon May 22, 2024
https://www.catalog.update.microsoft.com/Search.aspx?q=Microsoft%20Edge%20WebView2%20Runtime
vbryh-msft commentedon May 23, 2024
Colm Canavan (@ichijikuibo) wanghan123 Can you please collect and share the etw traces when you repro the issue
lflores-ms commentedon May 23, 2024
Colm Canavan (@ichijikuibo) wanghan123 Network logs might be helpful as well, please see instructions to capture.
ichijikuibo commentedon May 23, 2024
vbryh-msft lflores-ms I have an etw trace and network logs do you have an email I can send them too?
vbryh-msft commentedon May 30, 2024
We can not repro the issue - but we got the traces, thank you Colm Canavan (@ichijikuibo). It looks like there should be dump file also generated in
<UDF>\EBWebView\Crashpad\reports\(more about dumps). If somebody who is reproing it and have a dump - could you please let us knowichijikuibo commentedon May 30, 2024
I haven't got anything in that folder have you tried changing the userdata folder? Changing it defiantly makes the problem worse which is why in that screenshot I am on WebViewuserfolder3 in the origional issue I noticed I was loading multiple tabs with all with different userdata folders to isolate the cookies so userdata folder being different than what it was the last time webview was run could be a factor.

vbryh-msft commentedon Jun 10, 2024
we have a fix in Canary 128.0.2636.0+. Can folks with repro please verify that it works as expected and there is no freeze?
ichijikuibo commentedon Jun 10, 2024
That looks to be working now but I will try a bit more tomorrow I spent too long trying to get it to switch to canary before finally changing the folder in application.
kirwan-safesurfer commentedon Jun 10, 2024
vbryh-msft Thanks for the update. Apologies for our delay in reply, as we haven't had time to debug further. Could you please reply with steps on how to install (or apply) the Canary version of WebView2? I can't seem to find a Canary WebView2 runtime binary, only stable ones.
vbryh-msft commentedon Jun 10, 2024
Kirwan Smith (@kirwan-safesurfer) https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/prerelease-testing#start-by-doing-automated-testing-against-edge-canary
https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/set-preview-channel?tabs=api#interplay-between-the-webview2-prerelease-sdk-and-microsoft-edge-preview-channels
kirwan-safesurfer commentedon Jun 11, 2024
vbryh-msft I've created a wildcard DWORD value under
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\WebView2\ChannelSearchKindand set it to1, installed the Canary version of Edge, uninstalled my app, restarted my workstation, rebuilt my app, and checked the DevTools console withnavigator.appVersion, but it prints out 125.0.0.0. Am I missing something? I presume that my app isn't seeing a Canary runtime and is using the stable version instead, as per the documentation.ichijikuibo commentedon Jun 11, 2024
Kirwan Smith (@kirwan-safesurfer) That didn't work for me either i set the folder in the app like this
victorhuangwq commentedon Jun 11, 2024
Did the API method of switching the channel search order not work? https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/set-preview-channel?tabs=api#switching-the-channel-search-order-recommended
kirwan-safesurfer commentedon Jul 2, 2024
After further attempts, I couldn't get my WebView2 session to change channel. Regardless, I've tested again on the latest WebView2 runtime (126.0.2592.81) on a few devices, and the issue looks to be resolved now. Thanks again for your help!
vbryh-msft commentedon Jul 2, 2024
Yes, we backported the fix to all channels. Thanks everybody for the help with debugging!
vbryh-msft commentedon Jul 2, 2024
Kirwan Smith (@kirwan-safesurfer) - we added short doc how to easy test fixes/try new features in Canary - if it does not work for you and you want us help to debug - feel free to open new issue about that. Thanks