Mark Bult Design: San Francisco, CA, Established 1988

Web design and development for small and large business, e-commerce, b2b, b2c, SAAS, and community websites. User experience design and usability testing.


Friday, April 04, 2008

How to run multiple copies of (the same version of) Firefox

For the longest time, while using Firefox 1.x I was able to run two or more copies of the application at the same time. This was useful for partitioning my work and protecting it from being lost if there was a FF crash (which there were a lot of in the later Firefox 1.x days). If one instance crashed, the other would still keep chugging along. This was especially necessary because we didn't have Session Restore in back then.

When Firefox 2 came out, this capability was lost. I tried to figure out how to do it again by following several methods I saw mentioned on the the web, but none of them worked, and alas, I'm not nerdy enough to figure out why not. I'd always get a damn error message complaining that I'm not allowed to run multiple instances of the same app.

It didn't work even if you copied the app to a different folder and launched the copy. It didn't even matter if one was Firefox 2.1 and the other was Firefox 2.3.4. No work.

While you can run an old copy of Firefox 1.x at the same time as Firefox 2.x or even a beta copy of 3.x, you can't run two copies of Firefox 2.x on the same machine at the same time, not even if one is version 2.0 and the other is version 2.5.

An. Noy. Ing.

But, lo! I finally found a method that works. As you can see from the screenshot, I'm presently running three instances of the same version of Firefox on Mac OS X.



Here's how to do it:

First, Quit Firefox if it's running already.

Start Terminal and type in the directory path to your Firefox application. It'll probably be similar to mine below. Note that "espd" is my username, so yours will be different. "Firefox_dwOct.app" is what I've named my app, but yours will probably just be "Firefox". It must be followed by the rest: "/Contents/MacOS/firefox-bin" is standard for a normal Mac OS X install but it could be possibly be different for you (probably not, though).

espd$ /Applications/Firefox_dwOct.app/Contents/MacOS/firefox-bin -P YourProfileName -no-remote &



If you can't figure out the right path to the app's binary file (the "firefox-bin" part), then here's how to find it: In the Finder, open your Applications folder, find the Firefox icon, and right-click (or Control-click) to get the Contextual menu (pictured below), and select "Show Package Contents." That's how you see the files inside an application bundle.



Now, inside the Finder window that will open, you'll see a folder named "Contents." Double click it, and you'll see a few more icons, including a folder titled "MacOS." Open that one and look for the file called "firefox-bin", with an icon like a Terminal session (pictured below).



Now arrange your Terminal window and the Finder window so you can see them both, and simply drag the "firefox-bin" icon directly into the Terminal session after your username-prompt (pictured below), and it'll instantly fill in the correct path. OS X is pretty neat that way.



So once you've got the path to your Firefox app in Terminal, you'll need to change the example text "YourProfileName" to your actual profile name.

espd$ /Applications/Firefox_dwOct.app/Contents/MacOS/firefox-bin -P YourProfileName -no-remote &

If you don't know your profile name, here's how you find it: In the Finder, navigate from your Home folder (usually your username, like mine in the screenshot below) to the folders "Library > Application Support > Firefox".



Inside the Firefox folder is your "Profiles" folder. You probably only have one profile inside, and it probably has a weird name like "65d7ghtn.default", although it might instead be called something like "qtgfxqc3.YourName".

That "YourName" part will actually be a profile name, not "YourName". You chose a name when you first installed Firefox way back in the Dark Ages, and you've probably never seen it since. Whether it's "YourName" or "Fred" or just "default", you can put that in where I've got "YourProfileName" in the example below.

espd$ /Applications/Firefox_dwOct.app/Contents/MacOS/firefox-bin -P YourProfileName -no-remote &

Now just type the "-no-remote &" part, then hit your Return key and Firefox will launch the Profile Manager (pictured below). This is a part of Firefox most people never see, but it's handy. It's off by default, but the Terminal command "-P" turns it on.



Now you want to un-check the "Don't ask at startup" checkbox, because if you're going to use multiple profiles you want Firefox to launch the Profile Manager each time you start Firefox, so you can choose which profile to use.

If you only have one profile listed, at this point create a new one. Follow the dialog boxes and it'll step you through the process, then it'll launch the browser as normal.

Now go back to Terminal and copy and past the command again, this time using the other profile name you haven't initiated yet. A new Profile manager will launch, you can select the profile you haven't launched a browser for yet, and click the "Start Firefox" button.

Voila! Two instances of Firefox running, using two different profiles.

PS> I should note that it's the magic "-no-remote" Terminal command that allows you run two or more instances of an app. You can do it with many other apps too, if you like (not all will work, your results may vary).

Labels: , , , , ,

2 Comments

Blogger robertgarrigos said...

aaahhhh! Great! Mnay thanks, I was looking for this for ages.....

10/09/2008 07:32:00 PM

 
Blogger robertgarrigos said...

btw, use automator to create an .app icon to run this command with just a double click.

10/09/2008 07:46:00 PM

 

Post a Comment

<< Home