Search for the tab in which the http-on-study-response event was executed

I use nsIObserverService to monitor responses, but it fires events for all tabs (browser in Mozilla terminology). I would like to know which browser gets the response in my observation method.

+1
source share
1 answer

This example code snippet from DevMo should do the trick. It allows you to find the browser (tab) using nsICHannel from an HTTP request / response.

It specifically refers to the http-on-modify-request event, but aSubject should still be the nsICHannel for the http-on-examine-response event events.

+3
source

Source: https://habr.com/ru/post/1481124/


All Articles