]> git.pld-linux.org Git - packages/firefox.git/blame - mozilla-firefox.sh
- up to 38.0.1
[packages/firefox.git] / mozilla-firefox.sh
CommitLineData
763f73fd 1#!/bin/sh
2# based on script by (c) vip at linux.pl, wolf at pld-linux.org
3
bd6004c2 4LIBDIR="@LIBDIR@/mozilla-firefox"
f594d491 5
dd339e54
ER
6# compreg.dat and/or chrome.rdf will screw things up if it's from an
7# older version. http://bugs.gentoo.org/show_bug.cgi?id=63999
8for f in ~/{.,.mozilla/}firefox/*/{compreg.dat,chrome.rdf,XUL.mfasl}; do
9 if [[ -f ${f} && ${f} -ot /usr/bin/mozilla-firefox ]]; then
10 echo "Removing ${f} leftover from older firefox"
11 rm -f "${f}"
12 fi
13done
14
d97ddc70
JB
15FIREFOX="$LIBDIR/firefox"
16PWD=${PWD:-$(pwd)}
7dafdcbe 17
d97ddc70 18if [ "$1" = "-remote" ]; then
c88aa5e7 19 exec $FIREFOX "$@"
763f73fd 20else
d97ddc70
JB
21 if ! $FIREFOX -remote 'ping()' 2>/dev/null; then
22 if [ -f "$PWD/$1" ]; then
23 exec $FIREFOX "file://$PWD/$1"
763f73fd 24 else
c88aa5e7 25 exec $FIREFOX "$@"
763f73fd 26 fi
27 else
28 if [ -z "$1" ]; then
f176bc86 29 exec $FIREFOX -remote 'xfeDoCommand(openBrowser)'
d97ddc70 30 elif [ "$1" = "-mail" ]; then
f176bc86 31 exec $FIREFOX -remote 'xfeDoCommand(openInbox)'
d97ddc70 32 elif [ "$1" = "-compose" ]; then
f176bc86 33 exec $FIREFOX -remote 'xfeDoCommand(composeMessage)'
763f73fd 34 else
d97ddc70
JB
35 if [ -f "$PWD/$1" ]; then
36 URL="file://$PWD/$1"
763f73fd 37 else
38 URL="$1"
39 fi
f100f303 40 if ! grep -q 'browser\.tabs\.opentabfor\.middleclick.*false' ~/.mozilla/firefox/*/prefs.js ; then
5ab89eb1 41 exec $FIREFOX -new-tab "$URL"
763f73fd 42 else
5ab89eb1 43 exec $FIREFOX -new-window "$URL"
763f73fd 44 fi
45 fi
46 fi
47fi
This page took 0.080001 seconds and 4 git commands to generate.