Skip to content

Instantly share code, notes, and snippets.

@fellypsantos
Created March 21, 2022 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fellypsantos/e26cb86ec40c9fcbcf1104197dded813 to your computer and use it in GitHub Desktop.
Save fellypsantos/e26cb86ec40c9fcbcf1104197dded813 to your computer and use it in GitHub Desktop.
Script to intercept XMLHttpRequest calls made by some page.
/* Intercept XMLHttpRequests */
(function(open) {
XMLHttpRequest.prototype.open = function() {
this.addEventListener("readystatechange", function() {
console.log("readyState: "+this.readyState);
}, false);
open.apply(this, arguments);
};
})(XMLHttpRequest.prototype.open);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment