Boris Zbarsky wrote:

LeRoyK wrote:

I am working on Javascript instrumentation for Firefox 1.0x using a chrome extension.


How are you registering your nsIWebProgressListener?

I have never recorded the STATUS_SENDING_TO event. Does that one still occur?


The socket transport still sends it, yes....

-Boris

Thanks for the reply Boris. Here is how I register. This is called when my chrome window is loaded.


var webProgress = Components.classes["@mozilla.org/docloaderservice;1"].getService(Components.interfaces.nsIWebProgress);
if (webProgress) {
webProgress.addProgressListener(pdWebProgressListener, NOTIFY_STATE_ALL | NOTIFY_STATUS | NOTIFY_PROGRESS);
}


I remove it when the chrome window is unloaded.

var webProgress = Components.classes["@mozilla.org/docloaderservice;1"].getService(Components.interfaces.nsIWebProgress);
if (webProgress) {
webProgress.removeProgressListener(pdWebProgressListener, NOTIFY_STATE_ALL | NOTIFY_STATUS | NOTIFY_PROGRESS);
}


I am using the docloaderservice so that I will see nsIWebProgressListener events for every HTTP transaction in the instance.

For nsIProgressEventSink::onStatus() messages I use a an observer for "http-on-modify-request" events. If the aSubject is an instanceof nsIHttpChannel. I will hook the notificationCallbacks if the loadGroup is null. I do not see the nsIWebProgressListener interface used at all when the loadGroup is null. The notificationCallbacks hook is setup to forward everything to the original notificationCallbacks handler.

Yes, I saw in the source where STATUS_SENDING_TO is dispatched, I just have never recorded one.

Is it possible that this is a threading issue?

Thanks again,

LeRoy
_______________________________________________
Mozilla-netlib mailing list
Mozilla-netlib@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to