Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit b204a83

Browse files
marklagendijkqiyigg
authored andcommitted
doc(browser-support) improved Firefox documentation (#4553)
* docs(browser-support) Added documentation on headless Firefox setup. * docs(browser-support) Documented Firefox-specific options.
1 parent 8ac0f47 commit b204a83

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/browser-setup.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ capabilities: {
5454
},
5555
```
5656

57+
Adding Firefox-Specific Options
58+
------------------------------
59+
60+
Firefox options are nested in the `moz:firefoxOptions` object. A full list of options is at the [GeckoDriver](https://github.com/mozilla/geckodriver#firefox-capabilities) Github page. For example, to run in safe mode, your configuration would look like this:
61+
62+
```javascript
63+
capabilities: {
64+
'browserName': 'firefox',
65+
'moz:firefoxOptions': {
66+
'args': ['--safe-mode']
67+
}
68+
},
69+
```
5770

5871
Testing Against Multiple Browsers
5972
---------------------------------
@@ -118,7 +131,10 @@ browser2.$('.css').click();
118131

119132
Setting up PhantomJS
120133
--------------------
121-
PhantomJS is [no longer officially supported](https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE). Instead, we recommend either [running Chrome in Xvfb](http://www.tothenew.com/blog/protractor-with-jenkins-and-headless-chrome-xvfb-setup/) or using Chrome's [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome).
134+
PhantomJS is [no longer officially supported](https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE). Instead, we recommend to use one of the following alternatives:
135+
1. Chrome with [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). Available in Chrome 59+ on Linux/Mac OS X, and in Chrome 60+ on Windows.
136+
2. Firefox with [headless mode](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-headless). Available in Firefox 55+ on Linux, and in Firefox 56+ on Windows/Mac OS X.
137+
3. Chrome with [Xvfb](http://www.tothenew.com/blog/protractor-with-jenkins-and-headless-chrome-xvfb-setup/).
122138

123139

124140
Using headless Chrome
@@ -138,3 +154,17 @@ capabilities: {
138154
}
139155
}
140156
```
157+
158+
Using headless Firefox
159+
---------------------
160+
To start Firefox in headless mode, start Firefox with the [`--headless` flag](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-headless).
161+
162+
```javascript
163+
capabilities: {
164+
browserName: 'firefox',
165+
166+
'moz:firefoxOptions': {
167+
args: [ "--headless" ]
168+
}
169+
}
170+
```

0 commit comments

Comments
 (0)