I've lookup how to intercept an AJAX call and found the same code on multiple different threads: here and here, for instance.
I've modified the code like so:
(function(open) {
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
console.log("URL: ", url);
open.call(this, method, url, async, user, pass);
};
})(XMLHttpRequest.prototype.open);
All I'm trying to do is log the URLs of the AJAX requests on a given page.
Unfortunately, once I inject this code into Facebook, the entire screen freezes. It works on all other websites. Why is this messing up on Facebook?