Http-on-study-response observer - can I block the response from further processing?

I am trying to implement a firefox extension that filters incoming HTTP responses and processes them accordingly.

I want to block HTTP responses containing a specific header. After reading some of the MDC articles, the most common way to observe HTTP responses is to register an observer-client-observer.

My question is: with this observer, you can block the HTTP request from further processing (as a by-product, the page will continue to wait for an answer)? Or do I need to use some other XPCOM facet (if so, take care to point me in the right direction)?

Thanks in advance,
Mike

+5
source share
1 answer

It should be possible: the "subject" of this notification is an HTTP channel that you can call nsIRequest :: cancel () on.

the page does not continue to wait for a response, though, since you blocked the response. Perhaps you were really looking for a way to change the HTTP response ?

+3
source

All Articles