Skip to content

Instantly share code, notes, and snippets.

@couto
Last active December 17, 2015 22:58
Show Gist options
  • Save couto/5685530 to your computer and use it in GitHub Desktop.
Save couto/5685530 to your computer and use it in GitHub Desktop.
Warn about any AJAX request made synchronously, while navigating within the application
(function () {
var open = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function () {
var args = [].slice.call(arguments, 0);
if (!args[2]) {
console.error("Synchronous Request found!");
console.trace();
}
return open.apply(this, args);
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment