|
@ -13,12 +13,12 @@ namespace BBWYB.Client |
|
|
//{
|
|
|
//{
|
|
|
// Init();
|
|
|
// Init();
|
|
|
//}
|
|
|
//}
|
|
|
public void Init() |
|
|
public void Init(string folderName = "WebView2UserData") |
|
|
{ |
|
|
{ |
|
|
if (wb2 == null) |
|
|
if (wb2 == null) |
|
|
{ |
|
|
{ |
|
|
wb2 = new WebView2(); |
|
|
wb2 = new WebView2(); |
|
|
var wb2Setting = CoreWebView2Environment.CreateAsync(userDataFolder: io.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "WebView2UserData")).Result; |
|
|
var wb2Setting = CoreWebView2Environment.CreateAsync(userDataFolder: io.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), folderName)).Result; |
|
|
wb2.EnsureCoreWebView2Async(wb2Setting); |
|
|
wb2.EnsureCoreWebView2Async(wb2Setting); |
|
|
wb2.CoreWebView2InitializationCompleted += Wb2_CoreWebView2InitializationCompleted; |
|
|
wb2.CoreWebView2InitializationCompleted += Wb2_CoreWebView2InitializationCompleted; |
|
|
wb2.NavigationCompleted += Wb2_NavigationCompleted; |
|
|
wb2.NavigationCompleted += Wb2_NavigationCompleted; |
|
|