问题
Is there any way to hook into the eclipse web browser? I'm opening a link using IWorkbenchBrowserSupport.createBrowser, but after the page is launched I want to be able to take some action based on links clicked within the browser. Can you create a listener for browser events?
回答1:
No. IWorkbenchBrowserSupport.createBrowser returns an IWebBrowser. The IWebBrowser interface only defines 3 methods.
- close()
- getId()
- openURL(URL url)
I believe that openURL is used to navigate to another web page using the URL address text box.
You could write your own web browser that would allow you to create listeners for browser events.
来源:https://stackoverflow.com/questions/9517680/create-an-eclipse-plugin-that-responds-to-links-in-the-internal-web-browser