Browse Source

synchronize Mozilla Firefox control program with Mozilla Suite version by adding wmctrl and file:// support

Ralf S. Engelschall 20 years ago
parent
commit
1f4c05a5b4
2 changed files with 7 additions and 3 deletions
  1. 6 2
      firefox/firefox.sh
  2. 1 1
      firefox/firefox.spec

+ 6 - 2
firefox/firefox.sh

@@ -28,6 +28,7 @@ firefox_dir="@l_prefix@/lib/firefox"
 firefox_browser_bin="$firefox_dir/firefox"
 firefox_remote_bin="$firefox_dir/run-mozilla.sh $firefox_dir/mozilla-xremote-client"
 xsel_bin="@l_prefix@/bin/xsel"
+wmctrl_bin="@l_prefix@/bin/wmctrl"
 
 #   option parsing
 opt_v=no
@@ -94,7 +95,7 @@ for url in "$@"; do
             auto:* )
                 url=`echo "$url" | sed -e 's;^auto:;;'`
                 case "$url" in
-                    http://* | https://* | ftp://* ) ;;
+                    http://* | https://* | ftp://* | file://* ) ;;
                     www.* ) url="http://$url" ;;
                     ftp.* ) url="ftp://$url" ;;
                     *.tar.gz | *.tgz ) url="ftpsearch:$url" ;;
@@ -105,7 +106,7 @@ for url in "$@"; do
                 ;;
         esac
         case "$url" in
-            http://* | https://* | ftp://* )
+            http://* | https://* | ftp://* | file://* )
                 : # URL is already fully qualified
                 ;;
             google:* ) 
@@ -178,6 +179,9 @@ for url in "$@"; do
             done
         fi
 
+        #   try to activate (and bring to foreground) the Mozilla Firefox window
+        $wmctrl_bin -a "Mozilla Firefox" >/dev/null 2>&1 || true
+
         #   determine remote command
         if [ ".$opt_w" = .yes ]; then
             if [ ".$url" = ".about:blank" ]; then

+ 1 - 1
firefox/firefox.spec

@@ -33,7 +33,7 @@ Class:        PLUS
 Group:        Web
 License:      MPL
 Version:      1.0.4
-Release:      20050625
+Release:      20050701
 
 #   package options
 %option       with_optimize   yes