title: How to access innerHTML but ignore <script> tags
body: <p>I have a plugin that looks through the HTML and replaces text. However, with my current implementation text in script tags are getting caught in the search as well. This leads to broken scripts on the affected pages. </p>
  
  <pre><code>var pageText = document.body.innerHTML;
  document.body.innerHTML = pageText.replace(regextgoeshere);
  </code></pre>
  
  <p>I tried my best to filter it out through my regex pattern but I need to figure out how to skip all  tags.</p>
  
  <p>Is there a way to skip all  tags when getting innerHTML?</p>