- rel 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"
11 cp -rf $HOME/.iceweasek $HOME/.mozilla/firefox
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
29else
30 if [ -f "$PWD/$1" ]; then
31 URL="file://$PWD/$1"
32 else
33 URL="$1"
34 fi
35 if ! grep -q browser.tabs.opentabfor.middleclick.*false ~/.firefox/*/prefs.js; then
36 exec $FIREFOX -new-tab "$URL"
37 else
38 exec $FIREFOX -new-window "$URL"
39 fi
40fi
This page took 0.035191 seconds and 4 git commands to generate.