Search code examples
httpfirefoxprotocolspluggableprotocol

Http Passthrough Pluggable Protocol for Firefox


How can I make an http passthrough pluggable protocol for IE work in Firefox?

Alternatively, how to develop one for Firefox? Any examples would be appreciated.

Thanks.


Solution

  • Write an XPCOM object that implements nsIObserver. Then create listener for http-on-modify-request and http-on-examine-response.

    var myObj = new MyObserver(); //implements nsIObserver
    var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
    observerService.addObserver(myObj "http-on-modify-request",   false);
    observerService.addObserver(myObj, "http-on-examine-response", false);