Tarek
Tarek

Reputation: 819

SWT webkitbrowser and javascript

I am using the WebkitBrowser to run a browser app like on my desktop. I want to know it's possible for the WebkitBrowser widget to listen for javascript calls made when the user interacts with the browser applications' buttons.

I don't know if this will help but I am building the browser app with Ext GWT.

Upvotes: 0

Views: 833

Answers (1)

thehiatus
thehiatus

Reputation: 1575

I'm not so familiar with WebkitBrowser, but it looks like at the very least you could use a StatusTextListener to listen for changes in the status bar text and have Javascript modify that by editing the window.status field.

Also, I don't know how attached you are to WebkitBrowser, but the standard SWT Browser widget does support Javascript to Java communication through the BrowserFunction object.

Here's an example of using the BrowserFunction class from SWT snippets:

http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307.java?view=co

Upvotes: 1

Related Questions