#!/bin/sh
# based on script by (c) vip at linux.pl, wolf at pld-linux.org
-if [ `arch` == "x86_64" ]; then
- LIBDIR="/usr/lib64/mozilla-firefox"
-else
- LIBDIR="/usr/lib/mozilla-firefox"
-fi
+LIBDIR="@LIBDIR@/mozilla-firefox"
MOZILLA_FIVE_HOME=$LIBDIR
+MOZARGS=
MOZLOCALE="$(/usr/bin/locale | grep "^LC_MESSAGES=" | \
sed -e "s|LC_MESSAGES=||g" -e "s|\"||g" )"
for MOZLANG in $(echo $LANGUAGE | tr ":" " ") $MOZLOCALE; do
done
fi
+# compreg.dat and/or chrome.rdf will screw things up if it's from an
+# older version. http://bugs.gentoo.org/show_bug.cgi?id=63999
+for f in ~/{.,.mozilla/}firefox/*/{compreg.dat,chrome.rdf,XUL.mfasl}; do
+ if [[ -f ${f} && ${f} -ot /usr/bin/mozilla-firefox ]]; then
+ echo "Removing ${f} leftover from older firefox"
+ rm -f "${f}"
+ fi
+done
+
if [ -n "$MOZARGS" ]; then
FIREFOX="$LIBDIR/firefox $MOZARGS"
else
fi
if [ "$1" == "-remote" ]; then
- $FIREFOX "$@"
+ exec $FIREFOX "$@"
else
PING=`$FIREFOX -remote 'ping()' 2>&1 >/dev/null`
if [ -n "$PING" ]; then
if [ -f "`pwd`/$1" ]; then
- $FIREFOX "file://`pwd`/$1"
+ exec $FIREFOX "file://`pwd`/$1"
else
- $FIREFOX "$@"
+ exec $FIREFOX "$@"
fi
else
if [ -z "$1" ]; then
- $FIREFOX -remote 'xfeDoCommand (openBrowser)'
+ exec $FIREFOX -remote 'xfeDoCommand(openBrowser)'
elif [ "$1" == "-mail" ]; then
- $FIREFOX -remote 'xfeDoCommand (openInbox)'
+ exec $FIREFOX -remote 'xfeDoCommand(openInbox)'
elif [ "$1" == "-compose" ]; then
- $FIREFOX -remote 'xfeDoCommand (composeMessage)'
+ exec $FIREFOX -remote 'xfeDoCommand(composeMessage)'
else
if [ -f "`pwd`/$1" ]; then
URL="file://`pwd`/$1"
fi
grep browser.tabs.opentabfor.middleclick ~/.mozilla/firefox/*/prefs.js | grep true > /dev/null
if [ 0 -eq 0 ]; then
- $FIREFOX -remote "OpenUrl($URL,new-tab)"
+ exec $FIREFOX -remote "OpenUrl($URL,new-tab)"
else
- $FIREFOX -remote "OpenUrl($URL,new-window)"
+ exec $FIREFOX -remote "OpenUrl($URL,new-window)"
fi
fi
fi