This is BrainLog, a blog by Dan Sanderson. Older entries, from October 1999 through September 2010, are preserved for posterity, but are no longer maintained. See the front page and newer entries.

February 12, 2003

After I installed Mozilla 1.2.1 for Linux using Mozilla.org's x86 binary installer, I noticed that if I started a new Mozilla process when one was already running, it would complain about the default profile already being used, and I'd have to exit (or choose another profile). How annoying! When I run Mozilla, I just want a new window, not a new process.

Thankfully, it was easy to write a runmozilla script:

#!/bin/sh

HOMEPAGE="http://www.google.com/"

if /usr/bin/mozilla -remote "ping()"
then
  if test -z $1
  then

  
  /usr/bin/mozilla -remote "openURL($HOMEPAGE, new-window)"

  elif test -f $1

  then

  
  /usr/bin/mozilla -remote "openFile($1, new-window)"

  else

  
  /usr/bin/mozilla -remote "openURL($1, new-window)"

  fi

else

  /usr/bin/mozilla $*

fi


Strangely, when I had installed Mozilla 1.2.1 from RPMs (also from Mozilla.org), it never complained about profiles in use. (I had to purge that installation because it would crash when I tried to view Page Source. It may have been a botched RPM, I don't know.)

comments...

In my experience, most Moz packages from distros (Debian, fBSD, anyway) do -remotes by default, whereas the Moz distro itself requires scripting.



Sort of annoying, but shrug.



Tried Phoenix? Is much good (just don't grab a nightly -- CVS is pretty scary).

This entry is no longer accepting comments. Feel free to contact me if you have a question or a correction. Thanks!