Bug 20954 - [About] Feature Plugins dialog fails to launch web browser
Summary: [About] Feature Plugins dialog fails to launch web browser
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: Other Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Christophe Cornu CLA
QA Contact:
URL:
Whiteboard:
Keywords: readme
Depends on:
Blocks:
 
Reported: 2002-06-25 11:52 EDT by Jared Burns CLA
Modified: 2005-04-04 18:19 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2002-06-25 11:52:16 EDT
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.
Comment 1 Konrad Kolosowski CLA 2002-06-25 12:01:54 EDT
Routing to UI.
Comment 2 Kevin Haaland CLA 2002-06-25 15:48:52 EDT
The about dialog assumes that netscape is installed. 
Comment 3 Jared Burns CLA 2002-06-25 15:58:32 EDT
If the rest of the help system can use alternate browsers, shouldn't the about 
page?
Comment 4 Nick Edgar CLA 2002-07-04 11:24:35 EDT
Konrad, how does Help determine which browser to launch?
Is there an entry point in Help-Core that we could use?
Comment 5 Konrad Kolosowski CLA 2002-07-04 22:36:52 EDT
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);

Comment 6 Nick Edgar CLA 2002-07-05 12:09:27 EDT
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.
Comment 7 Randy Giffen CLA 2002-07-15 09:42:27 EDT
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 
Comment 8 Mike Wilson CLA 2002-07-15 14:01:29 EDT
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.
Comment 9 Eduardo Pereira CLA 2002-08-08 18:05:49 EDT
In Windows the API in swt.Program works for urls as well. Maybe it could be 
supported in other platforms too.
Comment 10 Andrew Irvine CLA 2002-11-19 16:23:58 EST
Looking for a way to launch the system web browser given a URL.  Solution 
should be applicable to all platforms.
Comment 11 Christophe Cornu CLA 2002-11-20 08:45:32 EST
Chrix to investigate and advise
Comment 12 Jared Burns CLA 2003-01-29 13:46:06 EST
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.
Comment 13 Dorian Birsan CLA 2003-01-29 13:56:18 EST
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.
Comment 14 Andrew Irvine CLA 2003-02-13 18:01:09 EST
Bug 30464 added code (for R2.1 M5) to check for mozilla as well as netscape on 
linux.
Comment 15 Christophe Cornu CLA 2005-04-04 18:19:57 EDT
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.