How I set up my isolated testing Firefox environment

October 31, 2010

Yesterday I covered how I actually run two web browsers, one for my real browsing and one for various sorts of testing and isolated browsing. That raises a question: how do you set up something like that?

In theory, you could just use an alternate Firefox profile (with a script to start your test Firefox with the right magic arguments). In practice I have never trusted Firefox's profile system that much, partly because in the past I spent some time testing out potentially buggy development builds. So I have always used the bigger hammer of changing my $HOME.

On Unix, Firefox (and Mozilla before it) has always respected $HOME (if set), instead of doing something unsocial like looking up the user's home directory in the passwd file. Thus the simplest way of getting a completely independent testing environment is changing $HOME to point to somewhere convenient. For my general testing Firefox environment, I use a persistent directory in ~/tmp (so that I can set Firefox preferences and have them stick); for scratch testing, you can just set $HOME to, say, /tmp/ffox-test, make the directory, run Firefox, and delete the directory afterwards.

You will also want to start the testing Firefox with the -no-remote command line argument (see here); otherwise your testing instance may just send things to your main browsing session. I deal with this in a somewhat eccentric way, so you may need to experiment with the best way of making everything work given Firefox's insistence on doing various bits of remote control.

(I put all of this stuff in a script that I call 'foxnative'. Remember to do 'export HOME' after setting $HOME, just to be sure.)

At one point I needed some extra steps to make sound work with PulseAudio, because it required some magic files in your home directory in order to connect to the PulseAudio server and it too respects $HOME. Back when I ran into this, I wound up using rsync to copy ~/.pulse to the new $HOME; however, that appears to be unnecessary now in current versions of Fedora.

(This shows one quiet little hazard of scripts, which is that they can automate something that turns into folklore over time while you're not paying attention.)

Written on 31 October 2010.
« A very convenient trick: having a testing browser
How I run two Firefoxes at once and still have remote control »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sun Oct 31 00:35:21 2010
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.