In short instead of alerting URLs and the response body I'd like to send it to my app. This code works but I can not use GM_xmlhttpRequest unless I grant it.
Changing nothing else the code magically breaks. I'm unsure what is changed and how to fix it. I thought I could use console.log
and copy/paste the data into my app however Facebook disables console.log.
I thought about doing xmlhttpRequest but that too is somehow blocked. I tested by executing code in a console. The 3 lines seem to work everywhere except on a Facebook domain. I believe it has something to do with CORS.
// ==UserScript==
// @name FBTest
// @namespace test
// @include https://*.facebook.com/*
// @version 1
// @grant none
// ==/UserScript==
//change none to GM_xmlhttpRequest
(function() {
var proxied = window.XMLHttpRequest.prototype.open;
window.XMLHttpRequest.prototype.open = function(method, url) {
alert(url);
return proxied.apply(this, [].slice.call(arguments));
};
})();