]>
Commit | Line | Data |
---|---|---|
54d6358a JR |
1 | #!/bin/sh |
2 | # based on script by (c) vip at linux.pl, wolf at pld-linux.org | |
3 | ||
4 | LIBDIR="@LIBDIR@/firefox" | |
5 | ||
6 | # copy profile from Iceweasel if its available and if no Firefox | |
7 | # profile exists | |
8 | if [ ! -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 |
13 | fi | |
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 | |
17 | for 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 | |
22 | done | |
23 | ||
24 | FIREFOX="$LIBDIR/firefox" | |
25 | PWD=${PWD:-$(pwd)} | |
26 | ||
27 | if [ -z "$1" ]; then | |
28 | exec $FIREFOX | |
e47e2da8 | 29 | elif [ $# -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 |
40 | else |
41 | exec $FIREFOX "$@" | |
54d6358a | 42 | fi |