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

StreamFilter.resume()

Parameters

None.

Return value

None.

Browser compatibility

BCD tables only load in the browser

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"]
);