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"],
);webRequest.StreamFilter.resume() / notebook
webRequest.StreamFilter.resume()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.