Listening to AJAX events at a global level

suggest change
// Store a reference to the native method
let open = XMLHttpRequest.prototype.open; 

// Overwrite the native method
XMLHttpRequest.prototype.open = function() {
    // Assign an event listener
    this.addEventListener("load", event => console.log(XHR), false);
    // Call the stored reference to the native method
    open.apply(this, arguments);
};

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents