@@ -381,7 +381,7 @@ def _set_firefox_options(
381
381
options .set_preference ("security.csp.enable" , False )
382
382
options .set_preference (
383
383
"browser.download.manager.showAlertOnComplete" , False )
384
- if headless :
384
+ if headless and "linux" not in PLATFORM :
385
385
options .add_argument ("--headless" )
386
386
if locale_code :
387
387
options .set_preference ("intl.accept_languages" , locale_code )
@@ -579,6 +579,11 @@ def get_remote_driver(
579
579
downloads_path , headless , locale_code ,
580
580
proxy_string , user_agent , disable_csp )
581
581
capabilities = firefox_options .to_capabilities ()
582
+ capabilities ['marionette' ] = True
583
+ if "linux" in PLATFORM :
584
+ if headless :
585
+ capabilities ['moz:firefoxOptions' ] = (
586
+ {'args' : ['-headless' ]})
582
587
for key in desired_caps .keys ():
583
588
capabilities [key ] = desired_caps [key ]
584
589
warnings .simplefilter ("ignore" , category = DeprecationWarning )
@@ -703,7 +708,19 @@ def get_local_driver(
703
708
"%s" % e )
704
709
sys .argv = sys_args # Put back the original sys args
705
710
warnings .simplefilter ("ignore" , category = DeprecationWarning )
706
- return webdriver .Firefox (options = firefox_options )
711
+ if "linux" in PLATFORM :
712
+ from selenium .webdriver .common .desired_capabilities import (
713
+ DesiredCapabilities )
714
+ firefox_capabilities = DesiredCapabilities .FIREFOX .copy ()
715
+ firefox_capabilities ['marionette' ] = True
716
+ if headless :
717
+ firefox_capabilities ['moz:firefoxOptions' ] = (
718
+ {'args' : ['-headless' ]})
719
+ return webdriver .Firefox (
720
+ capabilities = firefox_capabilities ,
721
+ options = firefox_options )
722
+ else :
723
+ return webdriver .Firefox (options = firefox_options )
707
724
elif browser_name == constants .Browser .INTERNET_EXPLORER :
708
725
if not IS_WINDOWS :
709
726
raise Exception (
0 commit comments