Add --disable-features=RendererAppContainer WebView2Environment option (#30412)
This commit is contained in:
Родитель
1daeba7e77
Коммит
415843f6f4
|
@ -130,7 +130,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
|
|||
DefaultBackgroundColor = Color.Transparent,
|
||||
};
|
||||
|
||||
var webView2Options = new CoreWebView2EnvironmentOptions("--block-new-web-contents");
|
||||
var webView2Options = new CoreWebView2EnvironmentOptions("--block-new-web-contents --disable-features=RendererAppContainer");
|
||||
ConfiguredTaskAwaitable<CoreWebView2Environment>.ConfiguredTaskAwaiter
|
||||
webView2EnvironmentAwaiter = CoreWebView2Environment
|
||||
.CreateAsync(userDataFolder: _webView2UserDataFolder, options: webView2Options)
|
||||
|
|
|
@ -125,10 +125,13 @@ namespace Microsoft.PowerToys.PreviewHandler.Monaco
|
|||
InitializeIndexFileAndSelectedFile(filePath);
|
||||
|
||||
Logger.LogInfo("Create WebView2 environment");
|
||||
var webView2Options = new CoreWebView2EnvironmentOptions("--disable-features=RendererAppContainer");
|
||||
ConfiguredTaskAwaitable<CoreWebView2Environment>.ConfiguredTaskAwaiter
|
||||
webView2EnvironmentAwaiter = CoreWebView2Environment
|
||||
.CreateAsync(userDataFolder: System.Environment.GetEnvironmentVariable("USERPROFILE") +
|
||||
"\\AppData\\LocalLow\\Microsoft\\PowerToys\\MonacoPreview-Temp")
|
||||
.CreateAsync(
|
||||
userDataFolder: System.Environment.GetEnvironmentVariable("USERPROFILE") +
|
||||
"\\AppData\\LocalLow\\Microsoft\\PowerToys\\MonacoPreview-Temp",
|
||||
options: webView2Options)
|
||||
.ConfigureAwait(true).GetAwaiter();
|
||||
webView2EnvironmentAwaiter.OnCompleted(async () =>
|
||||
{
|
||||
|
|
|
@ -225,7 +225,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Svg
|
|||
_browser.Dock = DockStyle.Fill;
|
||||
|
||||
// Prevent new windows from being opened.
|
||||
var webView2Options = new CoreWebView2EnvironmentOptions("--block-new-web-contents");
|
||||
var webView2Options = new CoreWebView2EnvironmentOptions("--block-new-web-contents --disable-features=RendererAppContainer");
|
||||
ConfiguredTaskAwaitable<CoreWebView2Environment>.ConfiguredTaskAwaiter
|
||||
webView2EnvironmentAwaiter = CoreWebView2Environment
|
||||
.CreateAsync(userDataFolder: _webView2UserDataFolder, options: webView2Options)
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace Microsoft.PowerToys.ThumbnailHandler.Svg
|
|||
thumbnailDone.Set();
|
||||
};
|
||||
|
||||
var webView2Options = new CoreWebView2EnvironmentOptions("--block-new-web-contents");
|
||||
var webView2Options = new CoreWebView2EnvironmentOptions("--block-new-web-contents --disable-features=RendererAppContainer");
|
||||
ConfiguredTaskAwaitable<CoreWebView2Environment>.ConfiguredTaskAwaiter
|
||||
webView2EnvironmentAwaiter = CoreWebView2Environment
|
||||
.CreateAsync(userDataFolder: _webView2UserDataFolder, options: webView2Options)
|
||||
|
|
Загрузка…
Ссылка в новой задаче