MCPcopy Create free account
hub / github.com/angular/components / unregisterServiceWorkers

Function unregisterServiceWorkers

docs/src/unregister-service-workers.ts:13–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 * whether there were service workers registered or not.
12 */
13export async function unregisterServiceWorkers(): Promise<boolean> {
14 if (!navigator.serviceWorker) {
15 return false;
16 }
17
18 const registrations = await navigator.serviceWorker.getRegistrations();
19
20 // Walk through every currently registered Service Worker and unregister it. There can be
21 // service workers from previous versions of the Angular Material docs.
22 registrations.forEach(registration => registration.unregister());
23
24 return registrations.length > 0;
25}

Callers 1

main.tsFile · 0.90

Calls 1

unregisterMethod · 0.80

Tested by

no test coverage detected