title: How to get text content of the entire document?
body: <p>I am building Chrome extension which at some point should determine current page language. In order to do that, my plan is to extract text content of the page (or at least a part of it) and pass it to translation api. However I couldn't find any strait forward way to just get all <code>textNode</code>s of the document.</p>
  
  <p>There is a backup plan which is to recursively analyze <code>$('body').contents()</code> until there is enough text content, but it feels a bit flaky. Perhaps there is a better way?</p>
  
  <p><br></p>
  
  <p>Note: Chrome extensions api allows your script to access user page dom as if it was the part of it.</p>