Recently, I've been attempting to override the XMLHttpRequest.protype.open method within Firefox's WebExtension environment. My current approach involves the following code snippet written in a content script:
var oldOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function (method, url, async, user, pass) {
console.log("url :"+url+"\n method: "+method);
oldOpen.apply(this,arguments);
};
Unfortunately, it seems that this code isn't functioning as intended. If you have any insights on how to successfully override the XMLHttpRequest.prototype.open method, your input would be greatly appreciated. Thank you!