Created
July 8, 2019 18:27
-
-
Save scodx/d82d76f5629d64ad8012afc764fb979f to your computer and use it in GitHub Desktop.
intercept ajax request on JS
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 oldXHROpen = window.XMLHttpRequest.prototype.open; | |
window.XMLHttpRequest.prototype.open = function(method, url, async, user, password) { | |
if (url.indexOf('getVideo') >= 0) { | |
this.addEventListener('load', function() { | |
console(this.responseText); | |
}); | |
return oldXHROpen.apply(this, arguments); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment