File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
py/selenium/webdriver/firefox Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,25 @@ def add_argument(self, argument):
110110 raise ValueError ()
111111 self ._arguments .append (argument )
112112
113+ @property
114+ def headless (self ):
115+ """
116+ Returns whether or not the headless argument is set
117+ """
118+ return '-headless' in self ._arguments
119+
120+ def set_headless (self , headless = True ):
121+ """
122+ Sets the headless argument
123+
124+ Args:
125+ headless: boolean value indicating to set the headless option
126+ """
127+ if headless :
128+ self ._arguments .append ('-headless' )
129+ elif '-headless' in self ._arguments :
130+ self ._arguments .remove ('-headless' )
131+
113132 def to_capabilities (self ):
114133 """Marshals the Firefox options to a `moz:firefoxOptions`
115134 object.
You can’t perform that action at this time.
0 commit comments