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 02:56 Go to next message
Alessio Pace is currently offline Alessio Pace
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] Fri, 28 October 2005 20:52 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro Izumi
Messages: 338
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 02:23 Go to previous message
Alessio Pace is currently offline Alessio Pace
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: Wed Apr 23 19:52:20 EDT 2014

Powered by FUDForum. Page generated in 0.02462 seconds