2 # based on script by (c) vip at linux.pl, wolf at pld-linux.org
4 LIBDIR="@LIBDIR@/mozilla-firefox"
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
8 for 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"
15 FIREFOX="$LIBDIR/firefox"
18 if [ "$1" = "-remote" ]; then
21 if ! $FIREFOX -remote 'ping()' 2>/dev/null; then
22 if [ -f "$PWD/$1" ]; then
23 exec $FIREFOX "file://$PWD/$1"
29 exec $FIREFOX -remote 'xfeDoCommand(openBrowser)'
30 elif [ "$1" = "-mail" ]; then
31 exec $FIREFOX -remote 'xfeDoCommand(openInbox)'
32 elif [ "$1" = "-compose" ]; then
33 exec $FIREFOX -remote 'xfeDoCommand(composeMessage)'
35 if [ -f "$PWD/$1" ]; then
40 if ! grep -q 'browser\.tabs\.opentabfor\.middleclick.*false' ~/.mozilla/firefox/*/prefs.js ; then
41 exec $FIREFOX -new-tab "$URL"
43 exec $FIREFOX -new-window "$URL"