Intercept Ajax request?
<p>I'm trying to intercept all the AJAX request made in plain vanilla JavaScript but what I've found on Stack Overflow doesn't seems to work.</p>

<p>The easiest (and I would say 'functional') code is the following :</p>

<pre><code> (function(open) {
  XMLHttpRequest.prototype.open = function() {
    alert('Intercept');
    open.apply(this, arguments);
  };
})(XMLHttpRequest.prototype.open);
</code></pre>

<p>I copy/pasted it on my current website that I know makes an AJAX request at some point, did the AJAX request, and no "alert" was displayed.</p>

<p>I'm using Chrome v49.0.2623.87</p>

<p>Is there a new reason that disabled it ?</p>