Use this function to create a webRequest.StreamFilter
object for a request. The stream filter gives the web extension full control over the stream, with the ability to monitor and modify the response. It's the extension's responsibility to write and close or disconnect the stream, as the default behavior is to keep the request open without a response.
You typically call this function from a webRequest
event listener.
Firefox uses an optimized byte cache for script requests. This optimized byte cache overrides the normal request caching. Data from this cache is not available in a form useful to extensions. If your extension needs to filter scripts, create your filter in webRequest.onBeforeRequest
. Doing this ensures that the filter is created prior to the attempt to load from cache, thereby avoiding the optimized cache.
To use this API you must have the "webRequestBlocking"
API permission, as well as the normal permissions needed for the event listener (the "webRequest"
permission and the host permission for the host).