MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Same UserData for multiple browsers with different custom scheme registrations
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
What happened?
I'm not sure if someone wrote the same thing before, but, at least having multiple entries might save someone a lot of time in the future.
- We have an application that creates multiple Browsers, for different use cases. Depending on the use case, there are custom scheme handlers.
- We setup all browsers with a custom user data folder to keep cache files safe.
- We create an environment using the user data folder, and different scheme registrations, depending on the use case.
I had noticed that creating multiple WebView2 objects and calling EnsureCoreWebView2Async with the diverging scheme registrations results in an error (Resource not state...).
We have circumvented that by registering all the custom schemes for all objects and then filtering it inside the resourceRequested/navigationstarting events.
Importance
Moderate. My app's user experience is affected, but still usable.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
126.0.2592.102 x64
SDK Version
No response
Framework
WPF
Operating System
Windows 11
OS Version
No response
Repro steps
create 2 different CoreWebView2EnvironmentOptions with the same userDataFolder BUT different set of SchemeRegistrations.
create 2 webview2 objects and call EnsureCoreWebView2Async.
the second one throws the exception
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
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 with the reported reproduction: create two CoreWebView2EnvironmentOptions instances sharing a userDataFolder but using different SchemeRegistrations, then initialize two WebView2 objects with EnsureCoreWebView2Async. Compare the first and second initialization behavior and confirm whether the second can complete without the reported Resource not state error; no source files or tests are identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100