title: Chrome Extension: How to reload/re-execute content script on Ajax request
body: <p>I'm trying to execute a content script for a certain site (inject a button or change the link) however I would like to do this as the user browses the website.</p>
  <p>The problem is that the web page is built dynamically with ajax requests as the user browses.</p>
  <p>I had solved this earlier in an extension I had written by actually injecting my JavaScript into the web page.</p>
  <p>I was wondering whether there is a better alternative of just being able to register for an ajaxComplete event or something similar in my content script so that I can re-execute.</p>
  <p>I can do the following:</p>
  <pre><code>function listener()
  {
      console.debug(&quot;listener fired.&quot;);
  }
  document.addEventListener(&quot;DOMSubtreeModified&quot;, listener, false);
  </code></pre>
  <p>However that fires way too many times during one page load.</p>