Click to See Complete Forum and Search --> : Changed html file assoc. in KDE, but have an issue (Firefox profiles)


servo_fan
03-17-2004, 12:51 PM
I've changed the html association in KDE, (3.1.4 in SuSE 9), to open Firefox, (firefox is installed in my home directory). If I click on an html file in Konquerer it starts Firefox and displays the html page. However, if Firefox is still open and I click on another html file in Konquerer, Firefox tries to open another instance of itself and it prompts me for a profile to use. If I choose my default profile, it errors, saying it is already in use.

Does anyone know of a way to prevent this from happening? Thanks.

mdwatts
03-17-2004, 01:27 PM
I've seen the same problem posted here a few times though I cannot remember the solution.

Have a look through these JL forum search results for 'mozilla profile' (http://justlinux.com/forum/search.php?s=&action=showresults&searchid=908879&sortby=lastpost&sortorder=descending).

servo_fan
03-17-2004, 03:13 PM
Thanks for clarifying with the Firefox profile angle. It has something to do with adding a -remote swtich to the firefox command, (http://www.mozilla.org/unix/remote.html).

I can now get Firefox to open a new window or tab without prompting for a profile, but it opens a blank window, (or tab), instead of the file I clicked on.

Thanks again for the tip.

Hayl
03-17-2004, 03:19 PM
#! /bin/bash
if ps -A | grep mozilla-bin;
then mozilla -remote "openURL($1, new-tab)"
else mozilla $1
fi

all you need to do is swap out the firefox script in /usr/bin for that script. NOTE: that script was written for mozilla so you will have to change the mozilla-bin and mozilla -remote stuff to the correct firefox commands.

servo_fan
03-17-2004, 03:31 PM
Thanks Hayl. I actually found something similar in a newsgroup. The person who posted it could not give credit to the author, but here it is. I think it's basically the same as what you posted.

I think your problem is that you're running mozilla-bin twice or more
and you need your apps to send their browser request to mozilla.sh. The
mozilla.sh is a dumb little script that says "open an instance of
mozilla-bin if one is not running, otherwise open a new window (or tab)"

Here's what my script looks like, it's for firefox, but you'll get the
concept:
#!/bin/sh
MOZILLA="/usr/bin/mozilla-firefox"
if $MOZILLA -remote "ping()" 2>/dev/null
then
echo "Mozilla already launch"
location=",new-tab"
exec $MOZILLA -remote "openURL($1$location)"
else
exec $MOZILLA "$@"
fi
exit 1

you could copy this, change the appropriate names and locations, save as
mozilla-remote in the /usr/bin directory (make it executable ;)). and
then tell KDE or whatever environment you're using to use
"mozilla-remote.sh" as your default browser.

Hayl
03-17-2004, 03:41 PM
Originally posted by servo_fan
Thanks Hayl. I actually found something similar in a newsgroup. The person who posted it could not give credit to the author, but here it is. I think it's basically the same as what you posted.

looks to be.

i wrote the one i posted, and it's GPL :) lol