Skip to content

Instantly share code, notes, and snippets.

View Dreamescaper's full-sized avatar

Oleksandr Liakhevych Dreamescaper

View GitHub Profile
@mrchess
mrchess / gist:1820380
Created February 13, 2012 20:57
Exposes a variable openHTTPs which keeps track of how many XMLHttpRequests you have active.
<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--;
}