Mozilla plans to introduce headless mode support in Firefox 55 Stable on Linux and Firefox 56 Stable on Windows and Mac devices.
Headless mode is a special display mode in which the web browser’s user interface elements are not shown. Since that is the case, it is used in special use cases, for instance when you run automated tests or need to display a site or service without the user chrome of the web browser.
Google Chrome supports headless mode already. We talked about how to enable it previously here on Ghacks, and I suggest you check out the guide if you want to find out how to run Chrome in headless mode.
For Firefox, you need to run Firefox 55 or later on Linux, or Firefox 56 or later on Windows or Mac, for support. You can check the version of the browser by loading about:support in the browser’s address bar. This reveals the version of Firefox, the channel, and other information.
Note: Headless mode does not work properly right now. When you try to load Firefox with the -headless parameter you will notice that the browser won’t start up at all. I tested this on Windows and Linux, and several different Firefox versions, and it did not work at the time of writing. I did not try to run it in conjunction with Selenium though, so this may work already.
Running Firefox in headless mode
The initial implementation of headless mode in Firefox is basic. You need to run the browser with the -headless parameter to enable it. I suggest you create a new profile or use a portable version of Firefox for that, as you may not want to run your main Firefox profile in headless mode.
The reason behind this is that you don’t get any user interface when you activate headless mode. This means that there is no address bar, no title bar, and no tab bar that you can interact with.