Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Getting the content of the Browser
Getting the content of the Browser [message #463152] Fri, 28 October 2005 06:56 Go to next message
Alessio Pace is currently offline Alessio PaceFriend
Messages: 7
Registered: July 2009
Junior Member
Hi all,
sorry I write again in few days for similar questions.

I was wondering how do I get the content of what is displayed by the
Browser component. It seems to me APIs are missing and that I should do
some sort of tricky hack via javascript, by means of
browser.execute(" window.status=window_document_content_as_string_in_some_way( ) ").

Thanks in advance,
Alessio Pace.
Re: Getting the content of the Browser [message #463192 is a reply to message #463152] Sat, 29 October 2005 00:52 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
Sorry if I misunderstood.
As for HTML, see Bug #107142
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=107142)
As for Text, see Bug #75815
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=75815)

- IE only -
Try browser.execute("alert(document.body.innerHTML)");
and browser.execute("window.status=document.body.innerHTML");
Changing status wont work, maybe.
Another one,
browser.execute("clipboardData.setData('Text',
document.body.innerHTML)");
This will work.
Re: Getting the content of the Browser [message #463235 is a reply to message #463192] Wed, 02 November 2005 07:23 Go to previous message
Alessio Pace is currently offline Alessio PaceFriend
Messages: 7
Registered: July 2009
Junior Member
Those alternatives work, but I fear that innerHTML is not w3c standard
but just something introduced into browsers for convenience.

I read the getText() proposal: I can't understand if it will be the text
of the rendered page or of the source page? For instance, if I open an
HTML document with 2 frames, will I get the string representation of
what I actually "see" rendered inside the browser component or the
string representation of the source document?


Toshihiro wrote:
> Sorry if I misunderstood.
> As for HTML, see Bug #107142
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=107142)
> As for Text, see Bug #75815
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=75815)
>
> - IE only -
> Try browser.execute("alert(document.body.innerHTML)");
> and browser.execute("window.status=document.body.innerHTML");
> Changing status wont work, maybe.
> Another one,
> browser.execute("clipboardData.setData('Text',
> document.body.innerHTML)");
> This will work.
>
>
Previous Topic:Possible to get the HTML text/source from the Browser widget?
Next Topic:generalization of Snippet 125 "Tooltip on TableItem" (for Tree or Table)
Goto Forum:
  


Current Time: Sat Apr 20 03:32:10 GMT 2024

Powered by FUDForum. Page generated in 0.03058 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top