Since Firefox doesn’t have innerText, I am using textContent to retrieve the text of the body of a document. However, textContent returns anything within noscript and script tags that are in the body (and maybe other tags, I’m not thoroughly sure), which means that textContent will look different that what is normally returned by innerText.
Is there an equivalent in Firefox that returns the same output as Chrome’s innerText function?
Edit
Included filter to not get content of certain elements
They are two different properties – one is defined in the W3C DOM 3 Core, the other is a Microsoft proprietary property that has been widely copied but has no open specification.
Probably the best way to normalise the two is to not use them, instead use a DOM-walking routine that collects text nodes and creates a string. Use the same routine for both (all) browsers.