From 4fb17247943ea449a89a8f94fd535678f7872fb7 Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Sun, 24 Nov 2002 00:24:04 +0000 Subject: Make the Mozilla startup scripts a little smarter. Instead of launching a new Mozilla instance each time, check to see if one already exists, and if so, spawn a new browser tab in the current window. PR: 45610 Submitted by: Nick Jennings --- www/seamonkey/Makefile | 4 ++-- www/seamonkey/files/mozilla.sh | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'www/seamonkey') diff --git a/www/seamonkey/Makefile b/www/seamonkey/Makefile index 0f2f416a3c29..7ef9a86ffacd 100644 --- a/www/seamonkey/Makefile +++ b/www/seamonkey/Makefile @@ -7,7 +7,7 @@ PORTNAME?= mozilla PORTVERSION= 1.2b -PORTREVISION?= 1 +PORTREVISION?= 2 PORTEPOCH?= 1 CATEGORIES?= www MASTER_SITES= ${MASTER_SITE_MOZILLA} \ @@ -174,7 +174,7 @@ post-patch: ${WRKSRC}/config/autoconf.mk.in post-build: - ${SED} -e "s;@PREFIX@;${PREFIX};g" -e "s;%%MOZILLA%%;${MOZILLA};g" \ + ${SED} -e "s|%%PREFIX%%|${PREFIX}|g" -e "s|%%MOZILLA%%|${MOZILLA}|g" \ ${FILESDIR}/mozilla.sh >${WRKSRC}/${MOZILLA} (cd ${WRKSRC}/dist/bin; \ ${SETENV} LD_LIBRARY_PATH=. MOZILLA_FIVE_HOME=. ./regxpcom; \ diff --git a/www/seamonkey/files/mozilla.sh b/www/seamonkey/files/mozilla.sh index efea04a63e16..0e34950cd32c 100644 --- a/www/seamonkey/files/mozilla.sh +++ b/www/seamonkey/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 "$@" + -- cgit v1.2.3