@@ -223,13 +223,15 @@ def _create_firefox_profile(
223
223
profile .set_preference ("pdfjs.disabled" , True )
224
224
profile .set_preference ("app.update.auto" , False )
225
225
profile .set_preference ("app.update.enabled" , False )
226
+ profile .set_preference ("app.update.silent" , True )
226
227
profile .set_preference ("browser.privatebrowsing.autostart" , True )
227
228
profile .set_preference ("devtools.errorconsole.enabled" , True )
228
229
profile .set_preference ("extensions.allowPrivateBrowsingByDefault" , True )
229
230
profile .set_preference ("extensions.PrivateBrowsing.notification" , False )
230
231
profile .set_preference ("extensions.systemAddon.update.enabled" , False )
231
232
profile .set_preference ("extensions.update.autoUpdateDefault" , False )
232
233
profile .set_preference ("extensions.update.enabled" , False )
234
+ profile .set_preference ("extensions.update.silent" , True )
233
235
profile .set_preference (
234
236
"datareporting.healthreport.logging.consoleEnabled" , False )
235
237
profile .set_preference ("datareporting.healthreport.service.enabled" , False )
@@ -514,27 +516,34 @@ def get_local_driver(
514
516
if headless :
515
517
options .add_argument ('-headless' )
516
518
if LOCAL_GECKODRIVER and os .path .exists (LOCAL_GECKODRIVER ):
517
- make_driver_executable_if_not (LOCAL_GECKODRIVER )
519
+ try :
520
+ make_driver_executable_if_not (LOCAL_GECKODRIVER )
521
+ except Exception as e :
522
+ print ("\n Warning: Could not make geckodriver"
523
+ " executable: %s" % e )
518
524
elif not is_geckodriver_on_path ():
519
525
if not "" .join (sys .argv ) == "-c" : # Skip if multithreaded
520
526
from seleniumbase .console_scripts import sb_install
521
527
sys_args = sys .argv # Save a copy of current sys args
522
- print ("\n Warning: geckodriver not found. "
528
+ print ("\n Warning: geckodriver not found! "
523
529
" Installing now:" )
524
- sb_install .main (override = "geckodriver" )
530
+ try :
531
+ sb_install .main (override = "geckodriver" )
532
+ except Exception :
533
+ print ("\n Warning: Could not install geckodriver!" )
525
534
sys .argv = sys_args # Put back the original sys args
526
535
firefox_driver = webdriver .Firefox (
527
536
firefox_profile = profile ,
528
537
capabilities = firefox_capabilities ,
529
538
options = options )
530
539
except WebDriverException :
531
- # Don't use Geckodriver: Only works for old versions of Firefox
540
+ # Skip Firefox options and try again
532
541
profile = _create_firefox_profile (
533
542
downloads_path , proxy_string , user_agent , disable_csp )
534
543
firefox_capabilities = DesiredCapabilities .FIREFOX .copy ()
535
- firefox_capabilities ['marionette' ] = False
536
544
firefox_driver = webdriver .Firefox (
537
- firefox_profile = profile , capabilities = firefox_capabilities )
545
+ firefox_profile = profile ,
546
+ capabilities = firefox_capabilities )
538
547
return firefox_driver
539
548
except Exception as e :
540
549
if headless :
0 commit comments