running mozilla multiple times

I’ve found that with recent (1.6, 1.7) versions of Mozilla on Linux, you aren’t able to run multiple instances of the browser. If Mozilla is already running and you try to run Mozilla again, you get the Profile Manager which is a nuisance and of little use.

My solution was to write a shell script to determine if an instance is already running. If it is it opens a new window and if it isn’t, it runs mozilla normally. It’s quite simple but I thought it might come in handy for others, so here it is.

#!/bin/sh

# Run Mozilla normally if there are no other instances.  If there are, open
#   a new window within the running instance.

mozilla="/usr/local/mozilla/mozilla"

pgrep -f $mozilla 1> /dev/null 2>&1

if [ "$?" == 0 ]; then
    $mozilla -remote "openURL(about:blank, new-window)"
else
    $mozilla
fi

Make sure the path to mozilla is correct, and if you want to open a new tab instead of a new window, change new-window to new-tab.







Number of readers
- home
comics
news links
other links

about me
blog archives
docs
entertainment
experiences
funny lists
humor
intellectual
interests
metafilter
music
opinions
photos
web designs
tools
software
webmaster help

Sign up
Enter your email address to be notified of new posts



Search blog archives

Calendar
June 2004
S M T W T F S
« May   Jul »
 12345
6789101112
13141516171819
20212223242526
27282930  







Random quote
(View all quotes)
"A poem begins with a lump in the throat. -- Robert Frost"










(?) Choose theme:  X X X X X X