Closed as not planned
Description
I'm trying to apply browser arguments to preview auto-play behavior for media elements in the browser using the --disable-features
startup flag.
I'm using the code like the following:
// must create a data folder if running out of a secured folder that can't write like Program Files
var browserFolder = Path.Combine(mmApp.Configuration.InternalCommonFolder, mmApp.Constants.WebViewEnvironmentFolderName);
var env = await CoreWebView2Environment.CreateAsync(
userDataFolder: browserFolder, options: new CoreWebView2EnvironmentOptions
{
AdditionalBrowserArguments = "--disable-features=\"PreloadMediaEngagementData, MediaEngagementBypassAutoplayPolicies\"",
}
);
await WebBrowser.EnsureCoreWebView2Async(env);
When I use this (or several other startup flags I've tried, my WebView control fails to initialize and I get a blank WebView canvas - the browser appears to not load. I also don't get an error or a trigger in the BrowserProcessFailed event.
I'm not sure whether I'm using the Arguments option correctly and haven't been able to dig up any examples.
Expected behavior
-
Should work 😄
-
If it fails should throw or have some indiciation on what failed
-
WebView Control WPF (1.0.1901.177
-
.NET 7.0
-
Windows 11