LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mozilla 1.5 launcher & profiles isn't working as I expect. (https://www.linuxquestions.org/questions/linux-software-2/mozilla-1-5-launcher-and-profiles-isnt-working-as-i-expect-106312/)

JordanH 10-20-2003 11:19 AM

Mozilla 1.5 launcher & profiles isn't working as I expect.
 
Hi All,

I installed mozilla 1.5 last week, however, it isn't working as I expected. Can someone please point out where I have misconfigured my mozilla 1.5?? I doubt this is a bug, it must be something on my end. Any help is appreciated.

(RH9 w/ Gnome and Mozilla 1.5)

Expected behaviour
1. Click the launcher to open a mozilla window (in a default profile, no questions asked)
2. Click the launcher again to open a second mozilla window (in the SAME default profile, no questions asked)

Actual behaviour
1. Click the launcher --> One mozilla window opens in a default profile, no questions asked.
2. Click the launcher again --> "Select user profile" dialog opens asking for me to pick a profile
3. Select the default profile --> Alert "Mozilla cannot use the profile "default" because it is in use. Please choose another profile or create a new one." OK
4. Click OK, create a new profile.
5. Create Profile --> No errors.
6. At Select User Profile dialog, choose new profile --> opens newly created profile.
7. Repeat from step 2 for every new mozilla session

Apparently I need a new profile for every launcher click... that is so not cool because I can't even link to mozilla from other applications if I already have a mozilla session open! Arg. What have I misconfigured?

Oh yes, one more note; If I <ctrl>-N from an existing mozilla session, a new window is created as expected.
_________________

Thewyzewun 10-21-2003 03:30 AM

This is because every time you open Mozilla you open a duplicate of the whole program into your RAM, rather than just pressing Ctrl-N and opening a new window (much more efficient). If you are having problems linking from other programs you might want to get Netscape instead (www.netscape.com probably) since it is much better supported.

JordanH 10-21-2003 05:38 PM

Wyze, almost but not quite.

When I ran my last version of mozilla (errr, 1.4.?) with the exact same command, re-launching the application just opened up a new session (not another new instance of the whole program). However, in 1.5, it appears that it *IS* trying to open up a whole new program instance.

Yes, because I am more keyboard adept than mouse apt, I usually use ctrl-n... however, when I'm browsing and I'm all like clikkityclikkity-wwdotw.com I like to use just the mouse... My middle button opens tabs, but I want a one-click option to open a separate window.. the launcer SHOULD do it like in v1.4.?

I appreciate your reply but using another application is not an answer I'll accept. Any other suggestions about why the behaviour changed? I suspect it's something *I* did.

Thewyzewun 10-22-2003 06:13 AM

You could always amend the launcher to open a new window rather than new session. I'm not sure how to tho, since I'm at college and thus at a Windows terminal at the moment :(

JordanH 10-22-2003 05:47 PM

That's exactly what I want to do but don't know how.

Furthermore... I just installed Firebird and it appears to have the same behaviour as v1.5! oohh NO! :(

JordanH 10-22-2003 08:35 PM

I love the smell of napalm in the morning, it smells like... Victory.

[edit: added note]
[edit 2: Change script to allow other programs to pass Args.]

Ok, here is what I had to do to get this thing working the way I wanted. I had to use two mozilla command line options to get this going.
In general form they are:
mozilla -remote "OpenURL(<url>, new-window)"
mozilla -remote ping
* note: Mozilla and MozillaFirebird handle the -remote "OpenU ... w)" command differently if <url> is left blank. Mozilla uses the homepage and FireBird leaves you in a blank screen.


The first opens a new window with the specificed URL and the second writes a message to std-err to notify the user if there is an existing open window. We need the latter because the -remote option just craps out if there isn't a browser window open to begin with.

To use the script, copy the text below into a file called /usr/local/bin/moz and make sure you modify the moz variable to point to your mozilla script. You can then use the moz command in your launchers.

#!/bin/sh
# Mozilla startup script
# I had issues with the way Mozilla spawned new windows. Fortunately,
# they gave us the ability to ping remote windows to see if any were open.
# They also let us spawn a new window from the existing session. yay.
# It's unfortunate that they didn't build this in automatically...
#
# Author: jordan_harkness@hotmail.com
# Files : /usr/local/bin/moz
# Usage : moz &

# Point this to your REAL script that runs mozilla
moz="/usr/lib/mozilla/mozilla"

isRunning=`2>&1 $moz -remote ping`
case $isRunning in
# Start a new mozilla session
"No running window found." )
$moz "$*"
;;

# Spawn a new mozilla window from the existing session
"Failed to send command." )
$moz -remote "OpenURL ( "$*" , new-window)"
;;

# Dude, something's wrong.
* )
echo "This was the return value: $isRunning"
echo "d'oh"
;;
esac

costasm 12-09-2003 07:53 AM

Jordan,

I am using your script and it works. The defaults web page does not come up. I was wondering if you had any idea how to fix it.

I tried finding where MozillaFB stores its configurations.

They are ~/.phoenix/default/*/lock /prefs.js (of all the weird places. What was wrong with .firebird). Anyhow the .js file is javascript. I guess you would have to execute the .js file.

Costas

JordanH 12-09-2003 09:20 AM

My observation from my previous post was this,
Quote:

* note: Mozilla and MozillaFirebird handle the -remote "OpenU ... w)" command differently if <url> is left blank. Mozilla uses the homepage and FireBird leaves you in a blank screen.
The default web page seems to only open up on first load. Why did they choose this behaviour? I don't know.
The home page is stored in prefs.js but you aren't supposed to edit that file by hand... check out this link for more info,http://www.mozilla.org/unix/customizing.html#prefs

The other option (kludge) is to adjust my script so that if there is no parameter specified, then it would fill in a default value. That is not a good solution for a multi-user system but if you are the only user then it might keep you satisfied until you find a real fix.

Please keep us posted on your progress because I am interested in the result as well.
J.

costasm 12-09-2003 10:46 AM

I looked at their page.

Are you talking about changing this line?

$moz -remote "OpenURL ( "$*" , new-window)"

Actually I thought maybe we can change the $* to be an optional parameter passed to the script

Just for my Bash understanding:
What does the following mean?

isRunning=`2>&1 $moz -remote ping`

I know your are pinging FB to find out if loaded but
specifically what does 2>&1 do?

Thanks

JordanH 12-09-2003 11:45 AM

2>&1 redirects the output from std-err to std-out.

Now why did I do that? Well, when I did -remote ping, the response returned on std-err but for me to capture it, I needed it on std-out. So.... I redirected std-err to std-out and voila, I now had my value for my isRunning flag.


All times are GMT -5. The time now is 01:13 AM.