You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone! I’m working with a WebView2 window in my WinUI3 app, and I’m trying to load browser extensions inside the window. Here’s the code I’m using:
CoreWebView2EnvironmentOptions options = new CoreWebView2EnvironmentOptions();
options.AreBrowserExtensionsEnabled = true;
CoreWebView2Environment environment = await CoreWebView2Environment.CreateWithOptionsAsync(null, null, options);
await WebView2Window.EnsureCoreWebView2Async(environment);
WebView2Window.Source = new Uri("http://localhost:" + port);
try
{
var res = await WebView2Window.CoreWebView2.Profile.AddBrowserExtensionAsync("C:\\Users\\username\\AppData\\Local\\Microsoft\\Edge\\User Data\\Default\\Extensions\\amkbmndfnliijdhojkpoglbnaaahippg\\1.18.10_0");
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.Message);
}
The problem is that when I call AddBrowserExtensionAsync, it throws an exception, but the error message (e.Message) is just an empty string.
I’m using WebView2 version 1.0.2651.64.
Has anyone run into this before or have any suggestions on how to make sure I’ve properly enabled AreBrowserExtensionsEnabled? Any help would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone! I’m working with a WebView2 window in my WinUI3 app, and I’m trying to load browser extensions inside the window. Here’s the code I’m using:
The problem is that when I call AddBrowserExtensionAsync, it throws an exception, but the error message (e.Message) is just an empty string.
I’m using WebView2 version 1.0.2651.64.
Has anyone run into this before or have any suggestions on how to make sure I’ve properly enabled AreBrowserExtensionsEnabled? Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions