Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have two instances of firefox running under separate profiles:

$ firefox -P default &
...
$ firefox -no-remote -P second &

Now I can open a new tab from the command line with:

$ firefox -new-tab http://unix.stackexchange.com

But how do I open a new tab in the second profile?

This:

$ firefox -P second -new-tab http://unix.stackexchange.com

opens a tab in the default profile, while:

$ firefox -no-remote -P second -new-tab http://unix.stackexchange.com

complains that there is already an instance running under that profile.

share|improve this question
1  
You need to use -new-instance instead of -no-remote (see bug #716110). But even that doesn't work as of Firefox 29: firefox -P second URL still contacts the first instance. –  Gilles May 10 at 11:47

1 Answer 1

It works now with firefox 29.0 on Linux:

To open a second firefox instance with a different profile:

firefox -P second -new-instance

To open a new tab in the second instance of firefox, which os already running:

firefox -P second -remote "openurl(http://example.com,new-tab)"


See Bug 716110 - split -new-instance flag out of existing -no-remote flag for additional hints (eg: post of Hayo).

As explained in the comments on this bug report, what is missing is a command that can be used for opening the first window and the second tab in the same way:

That could be done with a script along the lines of this (firefox-profile-instance):

#!/bin/bash

PROFILE="$1"
URL="$2"

if firefox -P "$PROFILE" -remote "ping()" >/dev/null 2>&1 ; then
    firefox -P "$PROFILE" -remote "openurl($URL,new-tab)"
else
    firefox -P "$PROFILE" -new-instance "$URL" &
fi

Now, while a firefox with the default profile is already running,
the first run of this starts a new browser with profile "second":

firefox-profile-instance second "http://example.com"

and running the same again opens a second tab in the same browser:

firefox-profile-instance second "http://example.com"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.