@@ -135,19 +135,29 @@ pub struct WebviewArgs {
135135}
136136
137137impl WebviewArgs {
138- const BASE_OPT : & str = "--disable-features=translate,msWebOOUI,msPdfOOUI,msSmartScreenProtection,RendererAppContainer" ;
139- const BASE_OPT2 : & str =
140- "--no-first-run --disable-site-isolation-trials --disable-background-timer-throttling" ;
141- const PERFORMANCE_OPT : & str = "--enable-low-end-device-mode --in-process-gpu --V8Maglev" ;
138+ const BASE_ARGS : & [ & str ] = & [
139+ "--disable-features=translate,msWebOOUI,msPdfOOUI,msSmartScreenProtection,RendererAppContainer" ,
140+ "--no-first-run" ,
141+ "--disable-site-isolation-trials" ,
142+ /* "--disable-breakpad",
143+ "--disable-component-update",
144+ "--disable-default-apps",
145+ "--disable-background-timer-throttling",
146+ "--disable-background-networking", */
147+ ] ;
148+
149+ const PERFORMANCE_ARGS : & [ & str ] = & [ "--enable-low-end-device-mode" , "--in-process-gpu" ] ;
142150
143151 pub fn new ( ) -> Self {
152+ let common_args = Self :: BASE_ARGS
153+ . iter ( )
154+ . chain ( Self :: PERFORMANCE_ARGS )
155+ . map ( |s| s. to_string ( ) )
156+ . collect ( ) ;
157+
144158 Self {
145- common_args : vec ! [
146- Self :: BASE_OPT . to_string( ) ,
147- Self :: BASE_OPT2 . to_string( ) ,
148- Self :: PERFORMANCE_OPT . to_string( ) ,
149- ] ,
150- extra_args : vec ! [ ] ,
159+ common_args,
160+ extra_args : Vec :: new ( ) ,
151161 }
152162 }
153163
@@ -164,7 +174,7 @@ impl WebviewArgs {
164174 } else {
165175 SEELEN_COMMON
166176 . app_cache_dir ( )
167- . join ( self . extra_args . join ( "" ) . replace ( "-" , "" ) )
177+ . join ( self . extra_args . join ( "" ) . replace ( '-' , "" ) )
168178 }
169179 }
170180}
0 commit comments