Monday, November 7, 2011

How to open multiple instances of firefox in linux

It can often be useful to have multiple Firefox browsers open at the same time. Particularly for testing web sites or any sort of web development. Or even just so you can be logged into two sites at the same time with different accounts.

Firefox provides such a feature with the -no-remote switch. The first step is to create multiple Firefox profiles. To do this, launch Firefox with the -ProfileManager switch.

On Windows click Start > Run then:
"C:\Program Files\Mozilla Firefox\firefox.exe" -no-remote -ProfileManager

On *nix launch the command:
firefox -ProfileManager

Then create a new profile. If you want to make a copy of your existing profile, simply create the new profile, then copy the current profile directory to the new profile directory.

Now you’re ready to launch Firefox with the -no-remote switch. The trick is that you need to select your second profile when you launch your second instance. So start Firefox as normal, then launch a second browser.

On Windows click Start > Run then:
"C:\Program Files\Mozilla Firefox\firefox.exe" -no-remote -P "secondprofilename"

On *nix launch the command:
firefox -no-remote -P secondprofilename


Now you should have two separate Firefox windows, each running independently of each other. If you click on links in another program, they will probably go whichever Firefox window you opened first. Enjoy.



List of command line arguments (incomplete)

See also the external links at the bottom of this article.
Command Result Example
profile "<path>" Starts with profile located at the given path.
Does not apply to Mozilla Suite/SeaMonkey 1.x
firefox.exe -profile "E:\myprofile"
P "<profile name>" Starts with a given profile name (profile name is case sensitive). firefox.exe -P "Joel User"
<url> Launches the application and opens the given URL(s). firefox.exe "www.mozilla.org" "www.mozillazine.org"
safe-mode Launches the application with extensions disabled and the default theme.
Does not apply to Mozilla Suite/SeaMonkey 1.x
firefox.exe -safe-mode
no-remote Enables running multiple instances of the application with different profiles; [1] used with -P
Does not apply to Mozilla Suite/SeaMonkey 1.x
firefox.exe -no-remote
height <value> Sets height of the startup window to <value>. firefox.exe -height 600
width <value> Sets width of the startup window to <value>. firefox.exe -width 800
ProfileManager Starts with Profile Manager. firefox.exe -ProfileManager
CreateProfile Create a new profile firefox -CreateProfile test
migration Starts the application with the Import Wizard
Does not apply to Mozilla Suite/SeaMonkey 1.x
firefox -migration
console Starts the application with a debugging console. firefox.exe -console
jsconsole Starts with the Error Console (Javascript Console). firefox.exe -jsconsole
inspector <url> Starts with the DOM Inspector. firefox.exe -inspector http://www.google.com/
chrome <url> Loads the specified chrome. firefox.exe -chrome chrome://inspector/content/inspector.xul
new-window <url> Loads a URL in a new browser window. firefox.exe -new-window <url>
new-tab <url> Loads a URL in a new tab. firefox.exe -new-tab <url>
install-global-extension "<path>" Installs an extension globally. firefox.exe -install-global-extension "C:\Temp\extension-file.xpi"

No comments:

Post a Comment