an0
an0

Reputation: 17530

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?

Upvotes: 9

Views: 9540

Answers (4)

gone
gone

Reputation: 1129

Another option, tested with: Eclipse Oxygen. 1a and using Nightly build 49.01 browser.

Name: Firefox (Nightly)
Location: /usr/bin/open
Parameters: -b org.mozilla.nightly

Upvotes: 0

srouse
srouse

Reputation: 11

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.

Upvotes: 1

maciej
maciej

Reputation: 408

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

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

Upvotes: 16

Thanh Nguyen
Thanh Nguyen

Reputation: 495

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

Upvotes: 2

Related Questions