Skip to content


Subversion checkout URL

You can clone with
Download ZIP


fix to support linux #9

wants to merge 3 commits into from

3 participants


Hello, I've made a first fix to make the pid detection and chrome work under ubuntu.

It would be nice if firefox were opening a new tab (-new-tab) if is detected that is already running. This works and is the default behavior in chrome.



Yay, first pull request, thanks! Forgot that we are using the PID check to see if the browser is already running. This won't work in Windows either.

Do you know what Firefox does if you start it with -new-tab and it isn't running yet? If it just starts up we could just add it as a default parameter.


I can check it out tonight when I get home. Thanks for the pull request! This stuff is really hard to write tests for so if you find bugs, keep them coming.


it works! if firefox is already running it start a new tab otherwise it start a new instance of firefox


Changing this does indeed work on Linux but breaks stopping an instance on Mac OS X. I'll fix it up this evening.


Ok I finally got around to reviewing this. Thanks again for the pull request. There are two problems:

  • The change to detecting the PID works on Linux but breaks closing browsers on Mac OS X.
  • Starting up a Firefox instance with --new-tab works great but the instance no longer gets killed if it is already open.
@ekryski ekryski closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
6 examples/local.js
@@ -3,16 +3,16 @@ var launch = require('../lib');
launch.local(function(err, launcher) {
// User the launcher api
launcher('', {
- browser : 'chrome'
+ browser : 'chromium'
}, function(error, worker) {
if(error) {
console.log('Error:', error);
- console.log('Launched Safari. Process id:',;
+ console.log('Launched chromium. Process id:',;
setTimeout(function() {
worker.stop(function() {
- console.log('Safari stopped');
+ console.log('chromium stopped');
}, 10000);
2  lib/local/instance.js
@@ -4,7 +4,7 @@ var EventEmitter = require('events').EventEmitter;
var getProcessId = function(name, callback) {
// Get the process with the given name if it is running
- exec("ps -clx | grep '" + name + "$' | awk '{print $2}' | head -1", function(err, stdout) {
+ exec("ps ax | grep '" + name + "$' | awk '{print $2}' | head -1", function(err, stdout) {
var pid = stdout.trim();
if(!pid) {
return callback(new Error('There does not seem to be a ' + name + ' process running'));
7 lib/local/platform/unix.js
@@ -10,9 +10,14 @@ var supportedBrowsers = exports.supported = [
process : 'chrome'
+ name : 'chromium',
+ pathQuery : 'which chromium-browser',
+ process : 'chrome'
+ },
+ {
name : 'firefox',
pathQuery : 'which firefox',
- process : 'firefox'
+ process : 'firefox --new-tab'
name : 'opera',
Something went wrong with that request. Please try again.