I want to use some kind of webbrowser object in java to navigate to an Ajax page and
(a) add a listener to a DOM element that fires every time the HTML is changed dynamically by the server
or
(b) inject Javascript into the DOM to fire a custom event or call a Java method via an external interface or something.
Any suggestions on components that might do this, please? Any component that merely displays the page being navigated to and captures user click event is no good, unfortunately.
I need to fire events when the HTML in the DOM changes. .
Thanks.
解决方案
You can checkout the SWTBrowser component. It can be embedded within a SWT component (and hence accessed using Java) and lets you inject Javascript and do anything else.