Skip to main content

Firefox profiles - A very useful feature for web development

Posted by bino_george on July 6, 2007 at 12:03 AM PDT

As a web developer, you probably have a few extensions that you have loaded like Firebug, Web developer etc that help debug your web app. Every now and then you may also have to reset the cache, cookies and any other settings in you browser to test some bug. This can be a real pain, considering that you use the same browser for checking your email, stock quotes or even do web banking etc. You don't want your normal browsing environment to get affected by your web development/debugging. Besides, who knows if any of the the many extensions/addons that you have installed is malicious and try to steal your banking information.

Firefox profiles

This is where the Firefox profiles come in. Basically a profile is a directory in your .mozilla/.firefox directory where all the relevant personal information is stored. This includes cookies, bookmarks, cached files etc. Because two processes operating on the same profile could potentially clobber each other, Firefox by default will attach to an existing session if you have the browser already running. So for exmaple, lets say that you have one browser top-level window open and then you try to open another Firefox session using the start menu. What happens is that Firefox starts up and detects the presence of an existing session and then basically tells the process of the existing window to create a new window. This behaviour is so that two processes cannot step on each other.

Profile Manager

The default profile that Firefox creates is called "default". Using the Profile manager, you can create a second profile called something else, lets say "devprofile" for web development. To do this you simply start
Firefox as follows :

firefox -no-remote -ProfileManager

This will bring up a dialog which you can use to create the new profile. Once you have created the new profile you can then use the following command line options to pick between the different profiles :

Selecting a profile

firefox -no-remote -p devprofile

What this does is to tell Firefox not to do the trick I mentioned earlier that defers to the existing process. This will force it to start a new Firefox process that uses the profile called devprofile.
This way you you can have one profile for normal browsing and one for development. Any extensions/addons that you install in the dev profile is only there in the dev profile and does not affect your normal profile. Also, if you clear the dev profile it does not clear your normal profile. Hope you found this useful, I certainly do use it a lot.

Here is a link to some of the Firefox command line options :

Related Topics >>