Skip to content

Instantly share code, notes, and snippets.

@0x1F602
Created August 6, 2021 02:52
Show Gist options
  • Save 0x1F602/4aee3cd0af9df674c32cd0d5bf73fbab to your computer and use it in GitHub Desktop.
Save 0x1F602/4aee3cd0af9df674c32cd0d5bf73fbab to your computer and use it in GitHub Desktop.
Intercept AJAX Tampermonkey Script
(function() {
'use strict';
XMLHttpRequest.prototype.realOpen = XMLHttpRequest.prototype.open;
var myOpen = function(method, url, async, user, password) {
console.log('h00ked', url);
// if(url != 'post.php') {
//call original
this.realOpen (method, url, async, user, password);
// }
// else {
// return 1;
// }
}
//ensure all XMLHttpRequests use our custom open method
XMLHttpRequest.prototype.open = myOpen ;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment