Headless browser for FireFox (similar to PhantomJS for Chrome)

752 views Asked by At

Is there a headless browser for FireFox (similar to PhantomJS for Chrome), that can be used with Karma?

Using the Grunt FireFox Launcher plugin causes, the browser to be launched every single time we build our JavaScript using GRUNT. We would like something which is more silent and redirects its output to the console window. Very similar to how PhantomJS works for Chrome. Any ideas?

2

There are 2 answers

0
DVG On

First and foremost: Phantomjs does not launch Chrome. Phantomjs is a javascript implementation of Webkit.

Now, if you want to run firefox headlessly you can run it inside XVFB. Without knowing anything about your build since you haven't included that, I'll just link to node xvfb which is probably a good place to get started: https://github.com/proxv/node-xvfb

0
Cymen On

PhantomJS runs webkit not Chrome. It is the same engine but Chrome adds quite a bit more (ie Intl support). There is no equivalent for Gecko -- the equivalent of webkit for Firefox. On Linux or OS X, you can use xvfb with Firefox to stop the window from popping up.