Last active
August 29, 2015 14:16
-
-
Save muthuishere/eda84b463fbf8d93067c to your computer and use it in GitHub Desktop.
Monitor All Ajax xmlhttp requests
This file contains 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
//On connection Open , Ajax start | |
var _open = XMLHttpRequest.prototype.open; | |
XMLHttpRequest.prototype.open = function() { | |
var cururl=arguments[1] | |
_open.apply(this, arguments); | |
} | |
//On Ajax Complete | |
var _send = XMLHttpRequest.prototype.send; | |
XMLHttpRequest.prototype.send = function() { | |
/* Wrap onreadystaechange callback */ | |
var callback = this.onreadystatechange; | |
this.onreadystatechange = function() { | |
if (this.readyState == 4) { | |
} | |
callback.apply(this, arguments); | |
} | |
_send.apply(this, arguments); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment