I am creating a Chrome extension that at some point should determine the current language of the page. For this, my plan is to extract the text content of the page (or at least part of it) and transfer it to the api translation. However, I could not find any simple way to just get all the textNode document.
There is a backup plan that must recursively parse $('body').contents() until there is enough textual content, but it will be a bit flaky. Perhaps there is a better way?
Note. The Chrome api extensions allow your script to access the dom user page as if it were part of it.
javascript jquery google-chrome google-chrome-extension
artemave
source share