diff options
Diffstat (limited to 'www/mozilla-devel/files/mozilla.sh')
-rw-r--r-- | www/mozilla-devel/files/mozilla.sh | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/www/mozilla-devel/files/mozilla.sh b/www/mozilla-devel/files/mozilla.sh index efea04a63e16..0e34950cd32c 100644 --- a/www/mozilla-devel/files/mozilla.sh +++ b/www/mozilla-devel/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 "$@" + |