views:

507

answers:

1

I am attempting to implement a firefox extension which filters incoming HTTP responses and handles them accordingly.

I wish to block HTTP responses containing a specific header. Having read through some of the MDC articles, it appears the most common way of observing HTTP responses is by registering an http-on-examine-response observer.

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

Thanks in advance,
Mike

+1  A: 

Should be possible: the "subject" of that notification is a HTTP channel, on which you can call nsIRequest::cancel().

the page will not continue to wait for a response, though, since you blocked the response. Perhaps you've been actually looking for a way to alter an HTTP response?

Nickolay