mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-27 14:59:16 +08:00
Add --disable-features=RendererAppContainer WebView2Environment option (#30412)
This commit is contained in:
parent
1daeba7e77
commit
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)
|
||||
|
Loading…
Reference in New Issue
Block a user