Q: How to setup non-default web browser on Mac OS X

Platform: Mac OS X 10.4.11/Intel
IDEA 7.0.2 #7590

Safari is my system default browser, but I want to view javadocs in Firefox.
When setting the preferences to use the command 'open -a Firefox ]]>' (img-1.gif) I get a error message (img-2.gif).
Entering the command in Terminal open the given URL in Firefox, and using open without the -a option opens the URL
in the default Browser instead of Firefox.
Selecting 'Firefox-bin' gives an error if Firefox is already running (see img-3.gif).



Attachment(s):
img-1.gif
img-2.gif
img-3.gif
9 comments
Comment actions Permalink

Hello Dirk,

What if to specify not "open -a firefox", but just "firefox"?

Platform: Mac OS X 10.4.11/Intel
IDEA 7.0.2 #7590
Safari is my system default browser, but I want to view javadocs in
Firefox.

When setting the preferences to use the command 'open -a Firefox
<url>' (img-1.gif) I get a error message (img-2.gif).

Entering the command in Terminal open the given URL in Firefox, and
using open without the -a option opens the URL

in the default Browser instead of Firefox.

Selecting 'Firefox-bin' gives an error if Firefox is already running
(see img-3.gif).

Alexander.


0
Comment actions Permalink

... another error message.



Attachment(s):
img-4.gif
0
Comment actions Permalink

And if you specify /path/to/Firefox.app ?

0
Comment actions Permalink

Applications on Mac OS X are directories in real (called bundles) and cannot be executed, see img-6.gif.
Therefore the 'open' command exists to launch an application. It locates the binary to execute and starts it. If the app is already running it is brought to front.

Selecting the executable file manually only seems to work when the app is not already running (see previous post).



Attachment(s):
img-6.gif
0
Comment actions Permalink

Applications on Mac OS X are directories in real (called bundles) and
cannot be executed, see img-6.gif.


Specifying full path to executable (smth like /Applications/Camino.app/MacOS/Camino)
works for me the first time.
But you're right, if the application is already opened, this command fails,
and with "open" prefix it also fails.
I think you could create a JIRA issue, just do not forget, please, specify
that the OS is Mac.

I have also found that when the browser with the full path is successfully
started, it however gets incorrectly calculated URL to required file. This
is also Mac-specific. I will create another issue.

Alexander.


0
Comment actions Permalink

Well, if it works the first time, IDEA seems to do it right (at least the
first time). Maybe you could verify with a small sample Java application,
that it works from Java at all?

0
Comment actions Permalink

I have the same problem under OSX  10.5.6. I can specify the path to firefox-bin but again it won't work if you already have firefox open.
I think the easiest fix is to let the 'open' command on OSX take arguments.
I can do  open -a /Applications/Firefox.app http://www.jetbrains.com/ all day and firefox just open a new tab with that specified url.
I also tried putting:  open -a  /Applications/Firefox.app and I get this error:


IntelliJ IDEA.jpg
I also tried making a bash script that contains:
open -a /Applications/Firefox.app $1
and chmod +x 'd it

but I get an error from IDEA that the browser could not be opened

maybe allowing us to use 'open' and put the args in single or double quotes would be an easier fix?

0
Comment actions Permalink

As a side note open -a /Applications/Safari.app/Contents/MacOS/Safari works on the command line and will open a new instance of Safari but if I specify:
/Applications/Safari.app/Contents/MacOS/Safari , Safari will launch, but a bad url of :

file:///Applications/IntelliJ%20IDEA%208.1.app/bin/file:/Users/xaymaca/IdeaProjects/flexplease/out/production/flexplease/HelloWorld.swf

0
Comment actions Permalink

Anyone know if there will be a fix for this or if there is a work around?  I too wish to use Firefox when not the default browser without having to close the browser before each launch.

0

Please sign in to leave a comment.