W3cubDocs

/Web Extensions

webRequest.Streamfilter.error

A string that will contain an error message after the onerror event has fired.

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
error
No
No
57
?
No
No
?
?
57
?
?
?

Examples

This example adds an onerror listener which logs the value of error.

function listener(details) {
  let filter = browser.webRequest.filterResponseData("12345");

  filter.onerror = event => {
    console.log(`Error: ${filter.error}`);
  }

  //return {}; // not needed
}

browser.webRequest.onBeforeRequest.addListener(
  listener,
  {urls: ["<all_urls>"], 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/error