Add-ons

webRequest.StreamFilter.resume()

Resumes a request that was previously suspended through a call to suspend().

You can't call this function until after the onstart event has fired.

Syntax

filter.suspend()

Parameters

None.

Return value

None.

Browser compatibility

ChromeEdgeFirefoxFirefox for AndroidOpera
Basic support No No5757 No

Examples

This example uses suspend/resume to delay a web request.

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

  filter.onstart = event => {
    filter.suspend();

    setTimeout(() => {
      filter.resume();
      filter.disconnect();
    }, 1000);

  }
}

browser.webRequest.onBeforeRequest.addListener(
  listener,
  {urls: ["https://example.org/"], types: ["main_frame"]},
  ["blocking"]
);

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,