Re: getting current page content (after DOM mutate)

Jonas Sicking <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Ash wrote:
> I may be missing something very obvious here, but:
> 
> I want to read the current page in Firefox when the page has largely
> been laid out using AJAX/Javascript. Specially I want the current text
> (a la IE's innerText) for page generated by Javascript.

.textContent is similar (if not identical) to .innerText.

> Say the current page is my GMail inbox. Now, if I dump
> window.content.document.body.innerHTML, I will only get the static
> HTML as downloaded from GMail which is fairly minimal as its fleshed
> out by later AJAX requests. I don't get the updated HTML/DOM that
> represents the GMail interface including all currently displayed
> messages subjects, labels, etc. (This is just an example, it's not
> only GMail I'm after, it's any page created dynamically on the client
> side) I want the actual contents of the current DOM even if mutated.
> Is this possible?

.innerHTML (or .textContent) gives you what you want. There is likely 
something else that is going wrong.

/ Jonas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.