Finding the tab that fired an http-on-examine-response event
I'm using the nsIObserverService 开发者_如何学Cto monitor the responses, but it fires events for all tabs (browser in Mozilla terminology). I'd like to know which browser is getting the response in my observe method.
This sample code snippet from DevMo should do the trick. It allows you to find a browser (tab) given an nsICHannel
from an HTTP request/response.
It specifically references the http-on-modify-request
event, but aSubject
should still be an nsIChannel
for http-on-examine-response event
events.
精彩评论