Переопределить прототип объекта XHR, например:
//Capture the original XHR.open method
var _XMLHTTPRequest_open = XMLHttpRequest.prototype.open;
//Overwrite the XHR.open method
XMLHttpRequest.prototype.open = function(){
//Do something, checks, etc.
//If permitted:
_XMLHTTPRequest_open.apply(this, arguments);
}