The Source for Java Technology Collaboration
User: Password:



Felipe Leme

Felipe Leme's Blog

Firefox, profiles, and Linux

Posted by felipeal on February 27, 2007 at 08:18 PM | Comments (4)

Have you ever spent hours trying to run 2 instances of Firefox on Linux, using command-line arguments (like -ProfileManager) that *used* to work, but now simply open a window in the same Firefox process? If you did, this blog is for you...

First of all, Mozilla-based products like Firefox use profiles. That feature is so useful that it deserves a blog of its own (no, I won´t reinvent the wheel). But basically speaking, it means you can create different profiles, each with its own mozilla data (like cookies, bookmarks, passwords, etc...), and use them simultaneously. This is quite useful when you are developing web applications and must test it as different users. Or in a more mundane (and less development-based) situation, when you need to access a website using 2 different accounts (for instance, I have 2 main GMail accounts, felipeal and felipealists, the former being my main user, and the latter used only for managing mailing lists).

So far, so good - no big news in the scenario I described above. The problem is, the CLI (command-line interface) seems to be broken in more recent versions of Firefox and/or Fedora Core. I.E., if I have a running firefox instance using the default profile, and type the following command in the shell:

firefox -P sidekickProfile
or even:

firefox -ProfileManager
it opens a new window using the same firefox process (and hence using the same profile), instead of starting a new process (with a different profile, or popping up the profile manager window, respectively)!

That issue has been hunting me for many months, but as I just needed that feature a couple of times during this period (and being a professional procrastinator :-), I never had the patience to figure it out what was wrong - I just su-ed to a new user and ran a different instance of firefox (which is an ugly hack).

Well, last week, I finally got ashamed of myself, decided to fight the laziness, and figured out what the problem was! Looks like somewhere in the Firefox/Mozilla evolution (I guess it was Firefox 1.5), the startup scripts assumed the responsibility of deciding if a new process should be started, or if the CLI parameters should be passed to an existing (remote) instance.

Long-story short, in order to achieve the desired (for me, at least) behavior, you must set the variable MOZ_NO_REMOTE, to any value (or even none, as seem in the second example below - don't ask me why, I've never seem such behavior before!). For instance:
MOZ_NO_REMOTE=hell,yes firefox -P sidekickProfile
MOZ_NO_REMOTE= firefox -ProfileManager
Or, in a nice Unix way, create aliases to do the job:
alias ff2=`MOZ_NO_REMOTE= firefox -P sidekickProfile`
alias pm=`MOZ_NO_REMOTE= firefox -ProfileManager`
As a final note, I will leave here my 2-cents rant: why have this behavior changed in recent versions of Firefox? I mean, I´m fine with the script taking the responsibility of reusing existing process (I guess that burden was taken care off by the Linux/Unix integration before), but once you *explicitly* pass CLI arguments to invoke the profile manager, why the hell should the script pass them to a running process???

Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Thanks a lot. I have been in the same situation as you have been and thought that the command-line was broken!! Good, now I can use both my gmail accounts in peace rather than doing the same ugly hack that you were doing :-)

    later,
    Rogue

    Posted by: roguexz on March 02, 2007 at 12:24 AM

  • Ok, the *nix way is fine for me at home. But at work I use windows. Do you know how can I achieve the same results on windows?

    Thanks for the great tip!

    Posted by: espardo on March 07, 2007 at 05:17 AM

  • How did I live before google? :-) One user post the tip at lifehacker blog entry you've linked. Just use the "-no-remote" command line option. That may work on *nix also but I can't test it now.

    Posted by: espardo on March 07, 2007 at 05:25 AM

  • Thank you. Thank you. Thank you. A thousand times, thank you! For years I have found this to be the single most aggravating misfeature in firefox. I am very, very happy to find a way around it.

    Posted by: swomoulfia on April 09, 2007 at 08:18 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds