title: Replacing Text in HTML with JavaScript
body: <p>I'm trying to write a JavaScript program without the use of jQuery to replace all visible target text on a webpage without messing up the page's functionality.</p>
  
  <p>Specifically I'm trying to make a Chrome extension that does it passively on sites such as Facebook.</p>
  
  <p>I've experienced limited success with the following:</p>
  
  <pre><code>checkLoad();
  function checkLoad(){
      if (document.readyState === "complete") {
          document.body.innerHTML = document.body.innerHTML.replace("target string", "replacement string");
      } else {
          setTimeout('checkLoad();', 500)
      }
  }
  </code></pre>
  
  <p>This code misses things like people's names, titles and such.</p>
  
  <p>I've looked around and can't seem to find a working solution. Any ideas?</p>