Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345736 - [Compatibility] Opening an HTML page goes external
Summary: [Compatibility] Opening an HTML page goes external
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1 RC3   Edit
Assignee: Remy Suen CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 09:39 EDT by Paul Webster CLA
Modified: 2011-06-06 11:38 EDT (History)
5 users (show)

See Also:


Attachments
WorkbenchPage patch v1 (1.07 KB, patch)
2011-05-26 14:31 EDT, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2011-05-13 09:39:21 EDT
When I click on one of our about.html in 4.1 it opens externally in FF.  When I do the same in 3.7, it opens in an internal web browser editor.

Remy, do you know if this is something we wired off in the compat layer?

PW
Comment 1 Remy Suen CLA 2011-05-13 09:46:53 EDT
(In reply to comment #0)
> When I click on one of our about.html in 4.1 it opens externally in FF.  When I
> do the same in 3.7, it opens in an internal web browser editor.

With 3.7 I20110428-0848 in a new workspace my HTML files are defaulted to externally.
Comment 2 Grant Gayed CLA 2011-05-13 12:45:46 EDT
(In reply to comment #1)
> (In reply to comment #0)
> > When I click on one of our about.html in 4.1 it opens externally in FF.  When I
> > do the same in 3.7, it opens in an internal web browser editor.
> With 3.7 I20110428-0848 in a new workspace my HTML files are defaulted to
> externally.

If you're on a very new linux distro then you'll probably find that the latest 3.7 build has more luck opening its internal Browser than 3.7M7.  There have been multiple fixes in this area related to WebKitGTK's ABI compatibility being broken between its 1.2 and 1.4 releases.
Comment 3 Chris Goldthorpe CLA 2011-05-13 12:50:50 EDT
On Windows 7 I'm seeing the same results as Paul, i.e. on 3.7 a browser editor is opened, on 4.1 an external window is opened. I have not tried Linux yet. As Grant noted an external browser is always opened if a Browser widget cannot be created successfully.
Comment 4 Paul Webster CLA 2011-05-13 13:46:04 EDT
(In reply to comment #3)
> On Windows 7 I'm seeing the same results as Paul, i.e. on 3.7 a browser editor

Chris, were there supporting changes made in o.e.ui.workbench that maybe I haven't picked up because my compat layer is a fork?

PW
Comment 5 Chris Goldthorpe CLA 2011-05-13 15:30:09 EDT
It appears that the BrowserLauncher class is not getting called on Eclipse 4.1 Here is the extension  which declares the default html editor.

<extension point="org.eclipse.ui.editors">
      <editor
         extensions="htm,html,shtml"
         icon="$nl$/icons/obj16/internal_browser.gif"
         id="org.eclipse.ui.browser.editorSupport"
         launcher="org.eclipse.ui.internal.browser.BrowserLauncher"
         name="%viewWebBrowserSupportTitle"/>
  </extension>

Here are several things I've noticed while debugging

With a clean workspace on Eclipse 3.7 opening an html file hits a breakpoint set in BrowserLauncher, on 4.1 it does not.

On Eclipse 4.1 the choice of external browser has no effect, the default system browser is used.

It appears that opening a .html file is always using the system browser rather than the code in org.eclipse.ui.browser.
Comment 6 Remy Suen CLA 2011-05-26 14:31:41 EDT
Created attachment 196695 [details]
WorkbenchPage patch v1

We added IEditorLauncher support in bug 335599.

But some time, many moons before in a galaxy far, far away, we had added code to "ignore" the org.eclipse.ui.browser.editorSupport editor id. Removing this check fixes the problem.
Comment 7 Remy Suen CLA 2011-05-26 14:32:14 EDT
(In reply to comment #6)
> Created attachment 196695 [details]
> WorkbenchPage patch v1

Fix released to CVS HEAD.
Comment 8 Remy Suen CLA 2011-06-06 11:38:39 EDT
Works fine for me with I20110604-2201 on Windows XP.

Paul, if this doesn't work on Linux for you, let me know.