diff --git a/GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs b/GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs index f8f9f22e..d57c9b12 100644 --- a/GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs +++ b/GUI/CustomControls/ExtensionsView/ExtensionStoreView.cs @@ -1,4 +1,5 @@ -using SuchByte.MacroDeck.ExtensionStore; +using Microsoft.Web.WebView2.Core; +using SuchByte.MacroDeck.ExtensionStore; using SuchByte.MacroDeck.GUI.Dialogs; using SuchByte.MacroDeck.Logging; using System; @@ -7,6 +8,7 @@ using System.Data; using System.Diagnostics; using System.Drawing; +using System.IO; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; @@ -22,12 +24,20 @@ public partial class ExtensionStoreView : UserControl public ExtensionStoreView() { InitializeComponent(); + + InitializeBrowser(); this.webView.SourceChanged += WebView_SourceChanged; this.webView.NavigationStarting += WebView_NavigationStarting; this.webView.NavigationCompleted += WebView_NavigationCompleted; this.Load += ExtensionStoreView_Load; } + private async void InitializeBrowser() + { + var env = await CoreWebView2Environment.CreateAsync(null, MacroDeck.UserDirectoryPath); + await webView.EnsureCoreWebView2Async(env); + } + private void WebView_NavigationCompleted(object sender, Microsoft.Web.WebView2.Core.CoreWebView2NavigationCompletedEventArgs e) { SpinnerDialog.SetVisisble(false, FindForm());