Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
541 views
in Technique[技术] by (71.8m points)

eclipse - Is there a way to add Google Chrome as an external web browser in Flash Builder Standalone for Mac?

It currently seems impossible to add Google Chrome as an external web browser in Flash Builder Standalone for Mac. In this context, Eclipse only cares about "Unix executables" and not .app files.

For example, the path to Firefox on a Mac is: /Applications/Firefox.app/Contents/MacOS/firefox-bin which is only found by right-clicking and choosing 'Show Package Contents' on Firefox.app in your Applications directory.

If you try to add Google Chrome as a new external web browser, you'll have to repeat this process to navigate to /Applications/Google Chrome.app/Contents/MacOS where the 'Google Chrome' Unix exxecutable resides.

The problem is that space in the name. If you attempt to click OK in Eclipse, you'll get an error preventing you from continuing:

The location value is not a valid path name

Are there any workarounds for this so I can use Chrome as my development browser only? I did some searching and all I could come up with was this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=297273

UPDATE: A kind and savvy Flash Builder engineer gave me a helpful tip. Note that you'll need to show hidden files in Mac, by opening Terminal and entering the following command:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Press Return to relaunch Finder. Once hidden files are shown, "You’ll find what you need in [YOUR WORKSPACE]/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs. There’s a 'browsers' property there that defines XML for defining Eclipse’s web browsers. Add a new browser location and name and restart Flash Builder."

In this case you'd add:

<external location="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" name="Google Chrome"/>

I can confirm that this works. Hopefully we won't have to resort to this kind of hackery on the next go around.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can do this from the UI in FB 4.5 - However, you need this exact path (unquoted and unescaped) in Preferences->Web Browser. Select "Use External Browser" and add the line below as the location (You may not need the 'name="Google Chrome" bit, but looks like it worked all in one line for me):

/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" name="Google Chrome

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...