Firefox

Jing Su jingsu-26n5VD7DAF2Tm46uYYfjYg at public.gmane.org
Wed Jun 30 20:22:27 UTC 2004


On Wed, 30 Jun 2004, Gilles Fourchet wrote:

> Date: Wed, 30 Jun 2004 16:00:54 -0400
> From: Gilles Fourchet <gilles.fourchet-zzOxFVvAfJPQT0dZR+AlfA at public.gmane.org>
> Reply-To: tlug-lxSQFCZeNF4 at public.gmane.org
> To: tlug-lxSQFCZeNF4 at public.gmane.org
> Subject: [TLUG]: Firefox
>
> Hi All,
>
> I would like to know how to set Firefox to be able to start it several
> times?
>
> Once it is started, every time I try to restart it, it asks me for a new
> profile.  I would like to avoid that.
>
> Thanks,
>
> Gilles


There are several scripts out there that can let you call "firefox" using
the same profile over and over again.... here's one that I whipped up from
way back in the day of mozilla, but have just continued to use.  I'm sure
you can google for more advanced or better working ones.

I have my firefox installed in /opt/firefox

I call this script "firefox", and but it in /usr/local/bin/

So when I type "firefox" at the command line, it's actually calling the
script, which decides how to handle it.

Suggestions from other LUGers for how to improve it is welcome as well.

.........<snip>...............
#!/bin/sh

#TARGET=/opt/mozilla/mozilla
TARGET=/opt/firefox/firefox

if [ "$1" == "-remote" ]; then
    # calling program is smart enough to do it...
    $TARGET $*

elif `$TARGET -remote "ping()" &> /dev/null`; then
    # there is already one running

    if [ -z "$1" ]; then
        $TARGET -remote "openURL("about:blank", new-window)"

    elif [ -f "$1" ]; then
        # okay, tedious work of trying to find the complete pathname
        # make two variables, trying to separate the path from file.
        file=`basename $1`
        path=${1%%${file}}
        # try to fully expand the path
        path=`pwd $path`
        # okay, issue the command
        $TARGET -remote "openFile(file://$path/$file, new-tab)"

    else
        $TARGET -remote "openURL($1, new-tab)"

    fi
else
    # no mozilla currently running
    exec $TARGET &
fi

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list