MicrosoftEdge / MicrosoftEdge/WebView2Feedback
[Problem/Bug]: Multiple webview2 sharing the same web context never navigate in parallel, only one after the other.
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with two WebView2 controls sharing WEBVIEW2_USER_DATA_FOLDER, navigating to the same URL, and compare it with separate contexts or different URLs. Use the reported delayed server responses and Fiddler observations to determine whether shared-context navigation is serialized; done means both requests can proceed in parallel on the stated Windows and stable runtime versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100