]>
Commit | Line | Data |
---|---|---|
39dfbd4b | 1 | #!/bin/sh |
2 | # based on script by (c) vip at linux.pl, wolf at pld-linux.org | |
beab7ea6 | 3 | |
4 | LIBDIR="@LIBDIR@/iceweasel" | |
5 | ||
124c2d2c | 6 | # copy profile from Firefox if its available and if no Iceweasel |
7 | # profile exists | |
8 | if [ ! -d $HOME/.iceweasel ]; then | |
9 | if [ -d $HOME/.mozilla/firefox ]; then | |
10 | echo "Copying profile from Firefox" | |
11 | cp -rf $HOME/.mozilla/firefox $HOME/.iceweasel | |
12 | fi | |
13 | fi | |
14 | ||
beab7ea6 | 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 | |
5ea62e69 | 17 | for f in ~/.iceweasel/*/{compreg.dat,chrome.rdf,XUL.mfasl}; do |
beab7ea6 | 18 | if [[ -f ${f} && ${f} -ot /usr/bin/iceweasel ]]; then |
19 | echo "Removing ${f} leftover from older iceweasel" | |
20 | rm -f "${f}" | |
21 | fi | |
22 | done | |
23 | ||
b7a84a55 | 24 | ICEWEASEL="$LIBDIR/iceweasel" |
b30f9b9c | 25 | PWD=${PWD:-$(pwd)} |
beab7ea6 | 26 | |
544ddc8d | 27 | if [ "$1" = "-remote" ]; then |
beab7ea6 | 28 | exec $ICEWEASEL "$@" |
29 | else | |
2186b510 | 30 | if ! $ICEWEASEL -remote 'ping()' 2>/dev/null; then |
b30f9b9c ER |
31 | if [ -f "$PWD/$1" ]; then |
32 | exec $ICEWEASEL "file://$PWD/$1" | |
beab7ea6 | 33 | else |
34 | exec $ICEWEASEL "$@" | |
35 | fi | |
36 | else | |
37 | if [ -z "$1" ]; then | |
38 | exec $ICEWEASEL -remote 'xfeDoCommand(openBrowser)' | |
544ddc8d | 39 | elif [ "$1" = "-mail" ]; then |
beab7ea6 | 40 | exec $ICEWEASEL -remote 'xfeDoCommand(openInbox)' |
544ddc8d | 41 | elif [ "$1" = "-compose" ]; then |
beab7ea6 | 42 | exec $ICEWEASEL -remote 'xfeDoCommand(composeMessage)' |
43 | else | |
b30f9b9c ER |
44 | if [ -f "$PWD/$1" ]; then |
45 | URL="file://$PWD/$1" | |
beab7ea6 | 46 | else |
47 | URL="$1" | |
48 | fi | |
334ceb62 | 49 | if ! grep -q browser.tabs.opentabfor.middleclick.*false ~/.iceweasel/*/prefs.js; then |
beab7ea6 | 50 | exec $ICEWEASEL -new-tab "$URL" |
51 | else | |
52 | exec $ICEWEASEL -new-window "$URL" | |
53 | fi | |
54 | fi | |
55 | fi | |
56 | fi |