Skip to content

Instantly share code, notes, and snippets.

@ilyaglow
Created December 6, 2021 22:24
Show Gist options
  • Save ilyaglow/3926a568155425a0b42754d4125b003b to your computer and use it in GitHub Desktop.
Save ilyaglow/3926a568155425a0b42754d4125b003b to your computer and use it in GitHub Desktop.
Intercepting XMLHttpRequest.send call by overwriting it's prototype
(function (send) {
XMLHttpRequest.prototype.send = function (body) {
console.log(body)
send.call(this, body)
}
})(XMLHttpRequest.prototype.send);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment