Hi I'm trying to make use of nsIHttpNotify in javascript through xpconnect. I followed some code (nsCookieHTTPNotify.cpp) and it seems to use it you first get nsINetModuleMgr then call registerModule(). So here is what I got.
var netModuleMgr = Components.classes["@mozilla.org/network/net-extern-mod;1"] .getService(Components.interfaces.nsINetModuleMgr); netModuleMgr.registerModule("@mozilla.org/network/moduleMgr/http/response;1", httpNotify); Where httpNotify is the nsIHttpNotify implementation. The trouble is loading any url httpNotify.onExamineResponse() does not get called. I'm assuming the problem is nsINetModuleMgr::registerModule() takes nsINetNotify as a parameter and not nsIHttpNotify, hence it doen't call the nsIHttpNotify::onExamineResponse() listener. In the cookie implementation we seem to cast the listener with nsIHttpNotify. So my question is did I get it all wrong? If not what can I do to get this thing working? I would also settle for another solution to get http response header for a request if available. Many thanks -- Mike Lee Website: http://www.exitspace.net/mike