I have a firefox extension that listens for "http-on-modify-request" and checks for all GET requests coming from firefox. I would like to be able to cancel the request (for example, return a failure code to the page) or change the request URI, but cannot do this. the nsiHttpChannel object simply does not allow this - for example
delete httpChannel;
or redirecting to an empty request
httpChannel = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest);
do not work (and you cannot change the URI).
So how do you both intercept and modify HTTP GET requests in the Firefox extension.
Anthony bak
source share