Community
Participate
Working Groups
The org.eclipse.swt.browser.Browser class offers no public accessor for getText() in order to return the HTML/source of the web page once rendered. I have successfully modified the Browser.java source to allow for such an ability, but I was not sure if this feature was not included for an explicit reason. I will be happy to share my modification if such a solution/enhancement is merited. Thank You.
Created attachment 26168 [details] My solution to add a getText() accessor to the Browser class Allows for the retrieval of rendered HTML from the Browser class
Created attachment 27161 [details] Same As Previous Solution, one int field (info) and two constants have been added New Field: int info; New Constants: static final int DOCHOSTUIFLAG_NO3DOUTERBORDER = 0x00200000; static final int DOCHOSTUIFLAG_THEME = 0x00040000; to constructor: info = Browser.DOCHOSTUIFLAG_THEME; if ((style & SWT.BORDER) == 0) info |= Browser.DOCHOSTUIFLAG_NO3DOUTERBORDER;
*** Bug 111611 has been marked as a duplicate of this bug. ***
Created attachment 27963 [details] final win32 Browser getText implementation To update, I've attached a final win32 Browser.getText() patch for 3.2, based largely on the one that was originally attached in comment 1. Thanks for looking into this and for submitting the patch! I've investigated this in mozilla, and it's a much more complicated task there (at least without writing to the local file system, which is undesirable). I have a POC that makes it work, but it uses way too many unfrozen APIs to commit to at this time. Will revisit this issue later in the 3.2 cycle.
Created attachment 28042 [details] final Safari Browser getText implementation Just for fun, here's the Safari implementation too.
*** Bug 55352 has been marked as a duplicate of this bug. ***
Is is possible to have the wm2003 version of getText() method?
Assuming you mean windows server 2003, it should be the same as comment 4.
What is very useful is to have two methods getText() and getHTML() to return the text as displayed and the raw html, respectively.
*** Bug 44636 has been marked as a duplicate of this bug. ***
any chance someone create a patch for v3.3? The current patch does not work for that.
I found out that the patch does still work, but you have to move it to the IE class, instead of the Browser class.
fixed > 0823, added Browser.getText() API which returns a string with HTML Adding "contributed" keyword since the win32 implementation took some inspiration from the attachment in comment 1.
Thanks!
What's the state of this on other platforms e.g. Linux, Mac? Or has it just been resolved for the win32 case?
It's implemented for Mozilla and Safari as well.
Cool. In that case, can you change this to 'All' instead of 'windows' and then I think this is particularly noteworthy too; a keyword 'noteworthy' might be in order :-) http://mea-bloga.blogspot.com/2007/08/noteworthy-keyword.html Alex
sure, changed