summaryrefslogtreecommitdiff
path: root/www/mozilla/files
diff options
context:
space:
mode:
Diffstat (limited to 'www/mozilla/files')
-rw-r--r--www/mozilla/files/mozilla.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/www/mozilla/files/mozilla.sh b/www/mozilla/files/mozilla.sh
index 699f5d9d52f1..cc1eff88a0b1 100644
--- a/www/mozilla/files/mozilla.sh
+++ b/www/mozilla/files/mozilla.sh
@@ -1,6 +1,22 @@
#!/bin/sh
-#
-# $FreeBSD$
-cd @PREFIX@/lib/mozilla
-exec ./mozilla "$@"
+MOZILLA_DIR="%%PREFIX%%/lib/mozilla"
+MOZILLA_EXEC="mozilla"
+LOCATION='new-tab'
+
+cd $MOZILLA_DIR || exit 1
+
+# catch calls for mozilla mail
+if [ "$1" = "-mail" ]; then
+ REMOTE_COMMAND="xfeDoCommand (openInbox)"
+else
+ REMOTE_COMMAND="openURL($@, $LOCATION)"
+fi
+
+# process found
+./$MOZILLA_EXEC -remote "ping()" &&
+./$MOZILLA_EXEC -remote "$REMOTE_COMMAND" && exit 0
+
+# no existing process
+exec ./$MOZILLA_EXEC "$@"
+