A string that describes the current status of the request. It will be one of the following values:
"uninitialized"
"transferringdata"
ondata
events. The extension can call filter functions such as write()
, close()
, or disconnect()
."finishedtransferringdata"
write()
function."suspended"
resume()
function, and can write response data using the filter's write()
function."closed"
close()
function. The filter will not fire any more events, and the extension may not call any filter functions."disconnected"
disconnect()
function. All further data will be delivered directly, without passing through the filter. The filter will not fire any more events, and the extension may not call any filter functions."failed"
error
, and may not call any filter functions.Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
status |
No |
No |
57 |
? |
No |
No |
? |
? |
57 |
? |
? |
? |
function listener(details) { let filter = browser.webRequest.filterResponseData(details.requestId); console.log(filter.status); // uninitialized filter.onstart = event => { console.log(filter.status); // transferringdata } filter.ondata = event => { console.log(filter.status); // transferringdata // pass through the response data filter.write(event.data); } filter.onstop = event => { console.log(filter.status); // finishedtransferringdata filter.disconnect(); console.log(filter.status); // disconnected } } browser.webRequest.onBeforeRequest.addListener( listener, {urls: ["https://example.com/*"], types: ["main_frame"]}, ["blocking"] );
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/StreamFilter/status