how does google's inbox async calls works?

211 Views Asked by At

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?

1

There are 1 best solutions below

0
On

They might sending XHR requests from internal iframe/s so overriding XMLHttpRequest in the console won't work.