Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

http-on-modify-request PROBLEM...

0 views
Skip to first unread message

zen

unread,
Jan 5, 2006, 10:06:54 PM1/5/06
to
Hi all,

How can I register the observer "http-on-modify-request" available only
to each window instead of the entire application? I have notice that
this event "http-on-modify-request" will be triggered even more if i
Open more navigator window, ie: Open 2 Firefox window will trigger this
event 2 times which i think is redundant, and hence i could not get the
HttpChannel correctly...

My question is, can I eliminate this by making the
"http-on-modify-request" only available to each window? and how?

Please advice.

Below is my code:


//***************************************
var a =
{
QueryInterface : function(aIID)
{
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsIObserver) ||
aIID.equals(Components.interfaces.nsIHttpNotify) ||
aIID.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
},

observe: function(aSubject, aTopic, aData)
{
if (aTopic == "http-on-modify-request")
{
aSubject.QueryInterface(Components.interfaces.nsIHttpChannel);
var uri = aSubject.URI.asciiSpec;
dump("*** " + uri + " ***\n");
}
}
}


function regListener()
{
observerService.addObserver(a, "http-on-modify-request", false);
}
function unregListener()
{
observerService.removeObserver(a, "http-on-modify-request");
}

window.addEventListener("load", regListener, false);
window.addEventListener("unload", unregListener, false);
//***************************************

0 new messages