Archive for May 2011

Running multiple instances of Chrome on Mac/Linux

Edit 2013/02/24 – This post is seriously out-of-date now. Chrome has built-in multi-profile support that’s much easier to use than these scripts. Use that instead!

Sometimes it’s handy to be able to have multiple browser instances open at once. For instance, Google’s Multiple Login only allows me to have 3 accounts signed in at once, which isn’t enough for me to have all the personal accounts I want to check plus my work account. Even if it could, I like to keep my personal and work search and browsing histories separate, so that it’s easier for me to find something I vaguely remember seeing recently.

When doing web development, it’s often handy to have one browser signed into the site as an admin, another signed in as a regular user, and one not signed in. Chrome’s “Incognito Window” feature can help with one of these, but you can’t have two Incognito windows at the same time (at least, not on Mac/Linux – I hear tell that the Windows version may have supported multiple incognito sessions at some point, but I don’t know if that’s still the case)

So.

I’ve created a little script. I call it chrome and it lives in ~/bin on all my machines. It detects the platform and calls the appropriate binary.

More importantly, it takes one (optional) parameter, which it uses to figure out which profile to run.

I usually start my day by running this script twice: once as chrome work and once as chrome personal. The order is significant, as clicking on urls in other applications will result in them being opened in the first profile that ran. So, while I’m at work I want most things to open in the work profile; if I’m not working I want a different default behaviour.

If you don’t pass a parameter, the script will invoke the default profile – the one that gets used if you don’t specify a profile at all.

I’ve put the script on github for your amusement and pleasure (and hardcore forking action).