]> git.pld-linux.org Git - packages/firefox.git/blame - firefox.sh
up to 88.0.1
[packages/firefox.git] / firefox.sh
CommitLineData
54d6358a
JR
1#!/bin/sh
2# based on script by (c) vip at linux.pl, wolf at pld-linux.org
3
4LIBDIR="@LIBDIR@/firefox"
5
6# copy profile from Iceweasel if its available and if no Firefox
7# profile exists
8if [ ! -d $HOME/.mozilla/firefox ]; then
9 if [ -d $HOME/.iceweasel ]; then
10 echo "Copying profile from Iceweasel"
89701f20 11 cp -rf $HOME/.iceweasel $HOME/.mozilla/firefox
54d6358a
JR
12 fi
13fi
14
15# compreg.dat and/or chrome.rdf will screw things up if it's from an
16# older version. http://bugs.gentoo.org/show_bug.cgi?id=63999
17for f in ~/.mozilla/firefox/*/{compreg.dat,chrome.rdf,XUL.mfasl}; do
18 if [[ -f ${f} && ${f} -ot /usr/bin/firefox ]]; then
19 echo "Removing ${f} leftover from older firefox"
20 rm -f "${f}"
21 fi
22done
23
24FIREFOX="$LIBDIR/firefox"
25PWD=${PWD:-$(pwd)}
26
27if [ -z "$1" ]; then
28 exec $FIREFOX
e47e2da8 29elif [ $# -eq 1 -a "$1" = "${1#-}" ]; then
54d6358a
JR
30 if [ -f "$PWD/$1" ]; then
31 URL="file://$PWD/$1"
32 else
33 URL="$1"
34 fi
44b64889 35 if ! grep -q browser.tabs.opentabfor.middleclick.*false ~/.mozilla/firefox/*/prefs.js; then
54d6358a
JR
36 exec $FIREFOX -new-tab "$URL"
37 else
38 exec $FIREFOX -new-window "$URL"
39 fi
e47e2da8
JP
40else
41 exec $FIREFOX "$@"
54d6358a 42fi
This page took 0.059283 seconds and 4 git commands to generate.