I am looking for a way to perform fulltext search on the DOM tree with JS. In two words, I would like to retrieve the list of text nodes which contain a given string.
<
If you have a modern browser, you can always use XPATH, since it has content-based search.
This is an example:
document.evaluate('//*[text()="' + string + '"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE).snapshotItem(0);
And with older browsers, you can shim XPATH in with something like http://llamalab.com/js/xpath/