I am using a Browser view in my application and i need to get the text selected by user. I tried creating mouse event but nothing is working. I am using following link to create the browser:
I also checked in documentation, there is no method like getSelectionText()
in SWT browser.
you could achieve this by executing java script function in the browser from your View.Write a java script to get the selection the text and execute it in the browser. Look at the Browser API:
browser.execute(script);
browser.evaluate(script);
Look at BrowserFunction
interface for java-javascript call back mechanism
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.