title: Can I "catch" a redirect executed by a script, with javascript eventListeners?
body: <p>I have an HTML page that includes only a script tag, I don't control the script and I can't change it (so I can't fire my custom event for example). 
  The script ends with a redirect (using <code>window.location</code>).  </p>
  
  <p>Is there a way to add a new script to the page that will listen to the page events and "catch" the redirect (actually it's better for me to catch the new loaded document)?
  Something like:</p>
  
  <pre><code>window.addEventListener('redirected', function() {
    // do staff
  });
  </code></pre>
  
  <p>(I know there is no "redirected" event, it's just for the example).</p>
  
  <p>It's very important to make it clear that the redirect isn't caused by an anchor click or back/forward button click, so I can't use events like click or popstate.</p>