@@ -1091,6 +1091,7 @@ pub(crate) struct PlatformSpecificWebViewAttributes {
10911091 theme : Option < Theme > ,
10921092 use_https : bool ,
10931093 scroll_bar_style : ScrollBarStyle ,
1094+ browser_extensions_enabled : bool ,
10941095}
10951096
10961097#[ cfg( windows) ]
@@ -1102,6 +1103,7 @@ impl Default for PlatformSpecificWebViewAttributes {
11021103 theme : None ,
11031104 use_https : false , // To match macOS & Linux behavior in the context of mixed content.
11041105 scroll_bar_style : ScrollBarStyle :: default ( ) ,
1106+ browser_extensions_enabled : false ,
11051107 }
11061108 }
11071109}
@@ -1153,6 +1155,14 @@ pub trait WebViewBuilderExtWindows {
11531155 /// Requires WebView2 Runtime version 125.0.2535.41 or higher, does nothing on older versions,
11541156 /// see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/?tabs=dotnetcsharp#10253541
11551157 fn with_scroll_bar_style ( self , style : ScrollBarStyle ) -> Self ;
1158+
1159+ /// Determines whether the ability to install and enable extensions is enabled.
1160+ ///
1161+ /// By default, extensions are disabled.
1162+ ///
1163+ /// Requires WebView2 Runtime version 1.0.2210.55 or higher, does nothing on older versions,
1164+ /// see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/archive?tabs=dotnetcsharp#10221055
1165+ fn with_browser_extensions_enabled ( self , enabled : bool ) -> Self ;
11561166}
11571167
11581168#[ cfg( windows) ]
@@ -1181,6 +1191,11 @@ impl WebViewBuilderExtWindows for WebViewBuilder<'_> {
11811191 self . platform_specific . scroll_bar_style = style;
11821192 self
11831193 }
1194+
1195+ fn with_browser_extensions_enabled ( mut self , enabled : bool ) -> Self {
1196+ self . platform_specific . browser_extensions_enabled = enabled;
1197+ self
1198+ }
11841199}
11851200
11861201#[ cfg( target_os = "android" ) ]
0 commit comments