LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   firefox launch script (https://www.linuxquestions.org/questions/linux-software-2/firefox-launch-script-190350/)

curmudgeon42 06-06-2004 11:59 AM

firefox launch script
 
I am using the following script to launch firefox (to avoid the well-known problem it has in launching two instances normally):

Code:

#! /bin/bash
#
if pgrep -u `id -un` "firefox-bin" > /dev/null ; then
    if [ -z "$1" ]; then
        mozilla-firefox -remote "xfeDoCommand (openBrowser)" &
    else
        mozilla-firefox -remote "openURL($1, new-window)" &
    fi
else
    mozilla-firefox $1
fi

this seems to work just fine if i launch the script from the cmd line. however, when i put the script into a KDE Menu item and click it, the second time you click (where the script uses the -remote switch), a 3rd toolbar item is created that says Starting Mozilla Firefox with a spinning hourglass. The 2nd window *does* open correctly, but this weird toolbar item stays there for 15 seconds or so. If I click the menu item a 3rd time, a third firefox window is created, along with a second weird spinning hourglass toolbar item.

The weird item is created only when launching the script from my KDE menu item, not if i run the script from a term window.

If my descriptions are bad, here is a screenshot of the weird item:
http://www.coffeegeek.net/firefox_launch.png

I have all of the behavior I need, I can create a new Firefox window by clicking on a link in my menu. However, this weird toolbar item is really bugging me. What is causing it? How I can get rid of it?

Thanks for the help,

~ Justin

spuzzzzzzz 06-06-2004 06:26 PM

I had that problem too, but I never really figured out what caused it. You can stop the hourglasses, though, by removing inter-process communication for your menu item. Or you can when you're using a desktop shortcut, anyway - its in the properties dialogue somewhere.

curmudgeon42 06-06-2004 08:20 PM

in the properties of the KDE menu item that was running the script, under advanced options, i unchecked "Enable Launch Feedback". now the hourglass thing doesn't appear. this seems to make the script work appropriately except the new window appears in the background instead of the foreground. if anyone knows if i can change that, it would be great.

i now notice another problem though; haven't yet tested if it is related to that change. after opening Thunderbird, anytime i try to open a second window using the script (the first works fine), i get an error saying "The file /content/navigator.xul cannot be found. Please check the location and try again." anyone know what this is all about?

~ Justin


All times are GMT -5. The time now is 07:59 PM.