Bug 76641 - Let a Browser Widget communicate with its host via the 'window.external' interface
Summary: Let a Browser Widget communicate with its host via the 'window.external' inte...
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Christophe Cornu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-20 05:12 EDT by Christian Oetterli CLA
Modified: 2005-12-06 09:16 EST (History)
1 user (show)

See Also:


Attachments
Demonstrates usage of a Browser's 'window.external' interface (29.16 KB, application/x-zip-compressed)
2004-10-20 05:13 EDT, Christian Oetterli CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Oetterli CLA 2004-10-20 05:12:35 EDT
Internet Explorer provides the facility to register an 'window.external' 
object (a COM Object which implements the IDispatch interface). With this 
facility one can communicate from a HTML page (using scripts) with its host 
client site (Java, SWT whatever).

With this feature one could for instance create a HTML Report which contains 
links to files that reside in the Eclipse Workspace, and, by clicking on that 
link, the file would be opened in Eclipse directly.

I have implemented this feature for Internet Explorer and it works fine for me.

The source code which contains the necessary modifications to Browser.java, 
WebSite.java, an simple IDispatch implementation (SimpleIDispatch.java) is 
attached to this feature request.

You may find this useful

   Sincerely Christian
Comment 1 Christian Oetterli CLA 2004-10-20 05:13:35 EDT
Created attachment 15296 [details]
Demonstrates usage of a Browser's 'window.external' interface
Comment 2 Christophe Cornu CLA 2004-10-27 18:16:27 EDT
Hi Christian,
Thanks for taking the time to post these.

window.external is only defined by Internet Explorer isnt'it? We are looking 
at solutions that could also be implemented on Safari and Mozilla since the 
SWT Browser uses these engines on Mac and Linux.

At the moment, HTML can pass information to the java app through the 
window.status (that triggers a 
org.eclipse.swt.browser.StatusTextListener.changed(..) notification). Not as 
fancy as window.external but more portable.
Very recently, we've added a Browser.execute(String script) that can be used 
to communicate the other way around - from java to the html document, via a 
String containing javascript commands.

Comment 3 Christophe Cornu CLA 2005-03-29 12:58:15 EST
closing per comment 2