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

How do I know if "http-on-modify-request" is for top level window?

10 views
Skip to first unread message

Chris Shearer Cooper

unread,
Oct 30, 2009, 1:59:28 PM10/30/09
to
I have code that is successfully getting notified for "http-on-modify-
request", but there are a couple of problems.

1) I get notified for everything the page does - all the scripts, all
the icons, etc. How can I tell which request is for just the top
window (the one that shows up in a tab)?

2) Sometimes I don't get the matching "http-on-examine-response",
which seems odd. Is there another observer I can install during the
"http-on-modify-request" that will definitely let me know when the
http request/response is done?

Thanks!
Chris

ant_katcin

unread,
Oct 31, 2009, 2:34:12 AM10/31/09
to
Hello.

1) You should check channel.flags

for any documents: LOAD_DOCUMENT_URI
for top level documents: LOAD_INITIAL_DOCUMENT_URI

something like this
if (channel.flags & nsIChannel.LOAD_INITIAL_DOCUMENT_URI) {
...
}

2) You also should install "http-on-examine-cached-response" observer.

Chris Shearer Cooper

unread,
Nov 2, 2009, 10:50:06 AM11/2/09
to

Brilliant - thanks!

0 new messages