Created
March 12, 2018 23:23
-
-
Save anonymous/1baccedc914568f85f1af2889dda8055 to your computer and use it in GitHub Desktop.
(source: https://jsfiddle.net/n8w4fggx/7/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var OGSend = XMLHttpRequest.prototype.send; | |
| XMLHttpRequest.prototype.send = function(){ | |
| console.log("I AM HOOKED!"); | |
| return OGSend.apply(this, arguments); | |
| }; | |
| var site = 'https://www.google.com'; | |
| // vanilla js | |
| var httpRequest = new XMLHttpRequest(); | |
| httpRequest.open('GET', site); | |
| httpRequest.send(); | |
| // Works with jquery too | |
| $.ajax(site); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment