WebView2 Multiple Instances and userdatafolders #4869
Unanswered
DotNet-Fan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello WebView2 Experts,
Using the fixed runtime version 119.0.2151.97 of webview2 in UWP app.
We have three instances of Microsoft.UI.Xaml.Controls webview2 control where user can enter different credentials for the same webapp with the same url in the 3 instances of webview2.
User has the option to share the same credentials or different credentials for the webapp.
How to set different custom Userdatafolder location for these three instances so that multiplelogins can be achieved or switch back to shared userdatafolder?
Tried setting System.Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", userDataFolder.Path) before the call to
EnsureCoreWebView2Async() , but somehow the behavior it is not consistent with the shared and non shared userdatapath for the webview2.
When the app starts , the default is shared userdata location and when user enters the credentials and then set back to multiple different userdatafolder and restart the app and when navigates it doesnt ask for the credentials to enter , but the old credentails is being used for all instances.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions