Community
Participate
Working Groups
Build 20020625 (GM2) Linux-GTK 1. Go to Help->About Eclipse Platform->Feature Details 2. Select any of the features and press the "More Info" button 3. A dialog appears that says "Unable to open web browser" If I go to Help->Help Contents, Mozilla is opened just fine and works as expected.
Routing to UI.
The about dialog assumes that netscape is installed.
If the rest of the help system can use alternate browsers, shouldn't the about page?
Konrad, how does Help determine which browser to launch? Is there an entry point in Help-Core that we could use?
Help UI plugin defines org.eclipse.help.ui.browser extension point that we introduced in 2.0. Help.ui plugin and win32 fragment provide several browser adapters through that point. Implementator interface has method boolean isAvailable(). For browser adapaters that we wrote, isAvailable returns true only on one platform. On Linux we have provided a Mozilla adapter that returns true only if it runs on Linux and mozilla executable is on the system path. In case there were more browser adapters contributed that return true on a given platform, one that will be used is determined from the choice in help preference page. If nobody adds additional adapters to Eclipse, our adapters will be used: SWT-wrapped IE on Windows, Mozilla on Linux, Netscape on AIX, HP, and Solaris. In that case we require Mozilla to be installed, and knowing this you should call mozilla on linux rather than netscape. We do not expose APIs to access the browsers. Additionaly, all the code is in help.ui not help plugin. Ideally, HTML browser functionality should be provided by SWT, as many plugins need a browser. Since nothing reliable exists that could provide embeded browser or launch external on all platforms, we have created this browser "framework" in help, but do not think current APIs nor implementation are mature enough to be advertised for use outside of help. Despite that, out of necessity, some plugins call our internal APIs. For example update.ui plugin ended up using our browser framework with code like this: org.eclipse.help.ui.browser.IBrowser browser = org.eclipse.help.ui.internal.browser.BrowserManager.getInstance().createBrowser (); browser.displayURL(url);
The about dialog should try several alternatives, including netscape and mozilla on Linux, and netscape and IE on Windows. We should also investigate whether there is some way to determine the system web browser on all platforms.
Currently netscape does need to be in the path on linux. A workaround may be to add a batch file called netscape to launch the browser you have. Ideally the workbench simply wants to use the browser installed in the OS. The same one you would get if you opened an html file in the OS file explorer. Currently SWT prvides API to launch the registered editor for a file. Program.launch Perhaps this API could also support URLs
Are you really just looking for a way to launch a browser given a URL? Is there no other communication going on? SN to think about this.
In Windows the API in swt.Program works for urls as well. Maybe it could be supported in other platforms too.
Looking for a way to launch the system web browser given a URL. Solution should be applicable to all platforms.
Chrix to investigate and advise
Until a cross-platform mechanism to launch the user's preferred web browser can be found, can we just get something that works on Linux? Can you just look for browsers on the users path and launch one? Even if it's not configurable, we at least need to be able to view the info.
You can probably try a number of browsers (mozilla, netscape, etc.)by calling "which <browser_name>" and see what return code you get. The one that works (if any) can be used to launch the url. Here some code copied from the Mozilla adapter for help: Process pr = Runtime.getRuntime().exec("which " + browser_name); (new StreamConsumer(pr.getInputStream())).start(); (new StreamConsumer(pr.getErrorStream())).start(); pr.waitFor(); int ret = pr.exitValue(); if (ret == 0) { // browser is available on the user's path; } StreamConsumer is just a wrapper for the standard streams.
Bug 30464 added code (for R2.1 M5) to check for mozilla as well as netscape on linux.
Closing PR. 3.1 M6 has new IWebBrowser API support. Eclipse Browser settings can be reached through Preferences > General > Web Browser. SWT has released SWT Browser since 3.0.