Created
February 13, 2012 20:57
Exposes a variable openHTTPs which keeps track of how many XMLHttpRequests you have active.
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
<script> | |
(function() { | |
var oldOpen = XMLHttpRequest.prototype.open; | |
window.openHTTPs = 0; | |
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) { | |
window.openHTTPs++; | |
this.addEventListener("readystatechange", function() { | |
if(this.readyState == 4) { | |
window.openHTTPs--; | |
} | |
}, false); | |
oldOpen.call(this, method, url, async, user, pass); | |
} | |
})(XMLHttpRequest); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment