Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem/Bug]: Multiple webview2 sharing the same web context never navigate in parallel, only one after the other. #4220

Open
applefanbois opened this issue Dec 8, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@applefanbois
Copy link

applefanbois commented Dec 8, 2023

What happened?

1- Create 2 webview2 and attach them to the same shared web context.
2-Navigate to the same url with both of them at about the same time.

You will see that the 2nd webview navigation will not begin until the 1st one completes its navigation (ie the server has responded).

We even made a test php call that wait for 10 seconds before returning the time started and ended.
We get this when we start navigating (or even Reloading) one after the other (very quickly).

Webview A : Start 16:14:02 - End 16:14:12
Webview B : Start 16:14:12 - End 16:14:22

We can clearly see that the second webview2 does not make the call until the first one complete. I saw that with Fiddler (tool) while the event navigationStarting is triggerering one after the other immediately.

It looks like both webview are using the same connection object or they are using a blocking mutex on something.

If they don't share the same web context, it all works in parallel.
If the url is different, they run in parallel.
On iOS/macCatalyst, WKWebview always navigate in parallel.

To share or isolate the web context, we use :
Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", userDataFolderPath);
await webView.EnsureCoreWebView2Async();

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

119.0.2151.97

SDK Version

1.4.231115000

Framework

WinUI3/WinAppSDK

Operating System

Windows 10, Windows 11, Windows Server

OS Version

No response

Repro steps

See my post above

Repros in Edge Browser

No

Regression

Don't know

Last working version (if regression)

No response

@applefanbois applefanbois added the bug Something isn't working label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants