LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Firefox 0.9 launcher script (https://www.linuxquestions.org/questions/linux-software-2/firefox-0-9-launcher-script-194673/)

Pathian 06-17-2004 02:23 PM

Firefox 0.9 launcher script
 
I just upgraded from Firefox 0.8 to 0.9 on my Slackware 9.1 install, but suddenly my launcher scripts no longer work. I hate that user profile window thing so this is the script I was using to bypass it and create new instances in new tabs.

#!/bin/bash
/usr/bin/mozilla-firefox -remote "openURL($@, new-tab)" || exec /usr/bin/mozilla-firefox "$@";

however, now when I run the script, I get the error
Error: No running window found
Even if I already have a Firefox window open. I've also tried this script.

#! /usr/bin/python
#fox_launch.py

import sys, os

if len(sys.argv) > 1:
URL = str(sys.argv[1])
else:
URL = ""

a = os.popen("ps ax | grep firefox")

detect_fox = a.read()

if detect_fox.count("firefox-bin") > 0:
os.popen2("mozilla-firefox -remote 'openURL(" + URL + ",new-window)'")
else:
os.popen2("mozilla-firefox " + URL)

But neither works correctly. Both will open a Firefox window if one is not open, but both fail if one is already open because they can't find the running window. Did they change something about the way the -remote flag works in 0.9? Has anyone found a working launch script?

Andrew Benton 06-17-2004 02:38 PM

Yes, they've been hacking at the script that launches Firefox http://bugzilla.mozilla.org/show_bug.cgi?id=177996 I find the firefox script attached to comment #79 on that bug http://bugzilla.mozilla.org/attachme...44&action=view works well for me. Save the page to your computer, make the script executable, rename it firefox and swap it for the firefox script in the firefox folder. I prefer to change the # comment from line 188 to 189 so it opens URL's in new tabs but it's up to you.

Pathian 06-17-2004 02:45 PM

Ah, Thanks for the help, I also found a kludge solution by making a script that does...

#!/bin/bash
rm /home/magician/.mozilla/firefox/default.p95/lock
mozilla-firefox "$@"

but I don't like it as much because it opens a new window instead of a tab


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