MCPcopy
hub / github.com/GoogleChrome/workbox / unregisterAllSWs

Function unregisterAllSWs

infra/testing/webdriver/unregisterAllSWs.js:15–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 * Note: a new page load is needed before controlling SWs stop being active.
14 */
15const unregisterAllSWs = async () => {
16 await executeAsyncAndCatch(async (cb) => {
17 try {
18 const regs = await navigator.serviceWorker.getRegistrations();
19 for (const reg of regs) {
20 await reg.unregister();
21 }
22 cb();
23 } catch (error) {
24 cb({error: error.stack});
25 }
26 });
27};
28
29module.exports = {unregisterAllSWs};

Callers 1

test-all.jsFile · 0.85

Calls 2

executeAsyncAndCatchFunction · 0.85
cbFunction · 0.85

Tested by

no test coverage detected