by placing this small snippet in chrome's console can hook to any ajax call in a page:
(function(open) {
XMLHttpRequest.prototype.open = function(method, url, async) {
console.log('ajax call!'); //do things
open.call(this, method, url, async);
};
})(XMLHttpRequest.prototype.open);
placing this in Gmail works but not in Google's new Inbox site. if ajax call are not made in this page - what other way do they use to get async data?
They might sending XHR requests from internal iframe/s so overriding XMLHttpRequest in the console won't work.