@@ -223,13 +223,15 @@ def _create_firefox_profile(
223223 profile .set_preference ("pdfjs.disabled" , True )
224224 profile .set_preference ("app.update.auto" , False )
225225 profile .set_preference ("app.update.enabled" , False )
226+ profile .set_preference ("app.update.silent" , True )
226227 profile .set_preference ("browser.privatebrowsing.autostart" , True )
227228 profile .set_preference ("devtools.errorconsole.enabled" , True )
228229 profile .set_preference ("extensions.allowPrivateBrowsingByDefault" , True )
229230 profile .set_preference ("extensions.PrivateBrowsing.notification" , False )
230231 profile .set_preference ("extensions.systemAddon.update.enabled" , False )
231232 profile .set_preference ("extensions.update.autoUpdateDefault" , False )
232233 profile .set_preference ("extensions.update.enabled" , False )
234+ profile .set_preference ("extensions.update.silent" , True )
233235 profile .set_preference (
234236 "datareporting.healthreport.logging.consoleEnabled" , False )
235237 profile .set_preference ("datareporting.healthreport.service.enabled" , False )
@@ -514,27 +516,34 @@ def get_local_driver(
514516 if headless :
515517 options .add_argument ('-headless' )
516518 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 )
518524 elif not is_geckodriver_on_path ():
519525 if not "" .join (sys .argv ) == "-c" : # Skip if multithreaded
520526 from seleniumbase .console_scripts import sb_install
521527 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! "
523529 " 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!" )
525534 sys .argv = sys_args # Put back the original sys args
526535 firefox_driver = webdriver .Firefox (
527536 firefox_profile = profile ,
528537 capabilities = firefox_capabilities ,
529538 options = options )
530539 except WebDriverException :
531- # Don't use Geckodriver: Only works for old versions of Firefox
540+ # Skip Firefox options and try again
532541 profile = _create_firefox_profile (
533542 downloads_path , proxy_string , user_agent , disable_csp )
534543 firefox_capabilities = DesiredCapabilities .FIREFOX .copy ()
535- firefox_capabilities ['marionette' ] = False
536544 firefox_driver = webdriver .Firefox (
537- firefox_profile = profile , capabilities = firefox_capabilities )
545+ firefox_profile = profile ,
546+ capabilities = firefox_capabilities )
538547 return firefox_driver
539548 except Exception as e :
540549 if headless :
0 commit comments