Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly set Firefox as External Web Browser of Eclipse on Mac OS X

The default setting "/Applications/Firefox.app/Contents/MacOS/firefox-bin" tries to start a new instance of Firefox every time, which is refused blatantly by Firefox if there is already one.

Then I tried to use the "open" magic and set it to:

Name: Firefox
Location: /usr/bin/open
Parameters: -a /Applications/Firefox.app %URL%

which solved the multiple instances problem.

However, another problem popped up. The URL of API gotten from the code under cursor(Open External Javadoc) lost its anchor part, i.e., ".../docs/reference/android/widget/ImageView.html#setImageDrawable(android.graphics.drawable.Drawable)" became ".../docs/reference/android/widget/ImageView.html". So after opening the page, I have to locate the API by myself, which is really tedious and unproductive.

So, how can I properly set Firefox as the External Web Browser to overcome both problems together?

like image 401
an0 Avatar asked May 30 '09 07:05

an0


3 Answers

Name: Firefox
Location: /usr/bin/open
Parameters: -a Firefox.app %URL%

Source: http://support.mozilla.com/en-US/questions/666771.

like image 71
maciej Avatar answered Nov 16 '22 03:11

maciej


In eclipse if you explicitly set Firefox as your external browser then it will attempt to start a new instance. However, if you set Firefox as your default system browser and select that option in eclipse, it will open a new window within the existing instance.

If for some reason you must have 2 instances then you can create a new firefox profile. I tried this but had LIMITED success. I was able to get the debugger running in a new instance only by creating this script and pointed to it in eclipse:

#! /bin/bash
/Applications/Firefox.app/Contents/MacOS/firefox-bin -P debug $1 $2 $3 $4 $5 $6 $7 $8 $9
like image 28
Thanh Nguyen Avatar answered Nov 16 '22 03:11

Thanh Nguyen


After some fiddling, i came up with a solution that requires Safari, /usr/bin/osascript and an applescript.

create an applescript like:

on run argv
    tell application "Safari"
        activate
        make new document at the beginning of documents
        set the_url to item 1 of argv
        set the URL of the front document to the_url
    end tell
end run

then save it somewhere, making a note of the path: /my/path/to/launch_url.scpt

In Eclipse:

  1. create a new external web browser config
  2. set Location to: /usr/bin/osascript
  3. set Parameters to: /my/path/to/launch_url.scpt %URL%

This was tested with Eclipse 3.5, and opens urls like the one an0 mentioned above.

like image 33
srouse Avatar answered Nov 16 '22 02:11

srouse