Skip to content

Instantly share code, notes, and snippets.

@thash
Created April 29, 2017 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thash/00e0d6ec85a6b383116a202a4ccef32d to your computer and use it in GitHub Desktop.
Save thash/00e0d6ec85a6b383116a202a4ccef32d to your computer and use it in GitHub Desktop.
var originalOpen = window.XMLHttpRequest.prototype.open,
originalSend = window.XMLHttpRequest.prototype.send;
function myOpen(method, url, async, user, password) {
console.log('console log ---------- myopen');
return originalOpen.apply(this, arguments);
}
function mySend(data) {
console.log('console log ---------- mysend');
return originalSend.apply(this, arguments);
}
window.XMLHttpRequest.prototype.open = myOpen;
window.XMLHttpRequest.prototype.send = mySend;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment