title: Capturing DOM rerender on Single Page Application
body: <p>On single page application such as Youtube, it is difficult to capture page load event because page loads only happens once. Any rerendering of the DOM components are not firing the window events. What is the most practical way of DOM rerender? (ex. polling for DOM change)</p>
  
  <p>I have tried </p>
  
  <pre><code>window.addEventListener("popstate");
  window.addEventListener("DOMContentLoaded");
  window.addEventListener("hashchange");
  window.addEventListener("beforeunload");
  window.addEventListener("message");
  window.addEventListener("load");
  </code></pre>
  
  <p>popstate works when you go back or go forward in the browser. Others don't fire at all. I am thinking of putting "unload" event to a DOM element and make that fire callback to register "unload" to another DOM element newly rendered. But this is also not too practical</p>
  
  <p>So what I want is a way to efficiently capture DOM rerendering on a single page application</p>