> For network my extension will need to observe:
> 1. the http requests made by the browser when the document loads (html
> +css+script+images+objects etc)
> 2. any subsequent XHR calls.
> 3. the server responses to the above

I think you could utilize "@joehewitt.com/firebug-http-observer;1"
component. This XPCOM notifies listeners about http-on-modify-request
(request started) and http-on-modify-request (response received) (all
headers info accessible).

Here is an example:

const httpObserver = CCSV("@joehewitt.com/firebug-http-observer;1",
"nsIObserverService");

Firebug.MonitorModel.HttpMonitor = extend(Firebug.Module,
{
    initializeUI: function(detachArgs)
    {
        // Register HTTP observer
        httpObserver.addObserver(HttpObserver, "firebug-http-event",
false);
    },

    shutdown: function()
    {
        httpObserver.removeObserver(HttpObserver, "firebug-http-
event");
    }
});


The "HttpObserver" should implement nsIObserver interface, where
observe method could be something like:

observe: function(subject, topic, data)
{
    try
    {
        var request = subject.QueryInterface(Ci.nsIHttpChannel);
        if (topic == "http-on-modify-request") {
            // Request start
        } else if (topic == "http-on-examine-response") {
            // Response received
        }
    }
    catch (err)
    {
        if (FBTrace.DBG_ERRORS)
            FBTrace.sysout("observe EXCEPTION", err);
    }
},

Honza


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to