GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

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.write().

Developer library 6

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.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

webRequest.StreamFilter.onstart

An event handler that will be called when the stream is opened and is about to begin delivering data. From this point on, the extension may use filter functions like write(), disconnect(), or close(). ## Examples This example will replace the page content with "replacement text": ```js function listener(details) { let filter = browser.webRequest.filterResponseData(details.requestId); filter.onstart = (event)

webRequest.StreamFilter.status

A string that describes the current status of the request. It will be one of the following values: - `"uninitialized"` - : The filter is not fully initialized. No filter functions may be called. - `"transferringdata"` - : The underlying channel is currently transferring data, which will be routed to the extension in one or more ondata events. The extension can call filter functions such as write(), close(), or d

JSON results · Services directory