Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
6 results across 6 corpora for webRequest.StreamFilter.
Developer library 6
webRequest
ng responses To modify the HTTP response bodies for a request, call webRequest.filterResponseData, passing it the ID of the request. This returns a webRequest.StreamFilter object that you can use to examine and modify the data as it is received by the browser. To do this, you must have the `"webRequestBlocking"` API permission as well as the `"webRequest"` [API permission](/docs/Mozilla/Add-ons/WebExtensions/manife
webRequest.filterResponseData()
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 listen
webRequest.StreamFilter
A `StreamFilter` is an object you use to monitor and modify HTTP responses. To create a `StreamFilter`, call webRequest.filterResponseData(), passing the ID of the web request you want to filter. You can think of the stream filter as sitting between the networking stack and the browser's rendering engine. The filter is passed HTTP response data as it's received from the network. It can examine and modify the data b
webRequest.StreamFilter.resume()
uest that was previously suspended through a call to suspend(). You can't call this function until after the onstart event has fired. ## Syntax ```js-nolint StreamFilter.resume() ``` ### Parameters None. ### Return value None. ## Examples This example uses suspend/resume to delay a web request. ```js function listener(details) { let filter = browser.webRequest.filterResponseData(details.requestId); fil
webRequest.StreamFilter.onstop
An event handler that will be called when the stream has no more data to deliver. In the event handler you can still call filter functions such as write(), disconnect(), or close(). ## Examples This example will append "extra stuff" to the response: ```js function listener(details) { const filter = browser.webRequest.filterResponseData(details.requestId); const encoder = new TextEncoder(); filter.ondata = (
webRequest.StreamFilter.write()
Writes some response data to the output stream. You can only call this function after the onstart event has fired. ## Syntax ```js-nolint filter.write( data // ArrayBuffer or Uint8Array ) ``` ### Parameters - `data` - : [`Uint8Array`](/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) or [`ArrayBuffer`](/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer): array of bytes containing the data t