Created
April 26, 2021 20:39
-
-
Save neg4n/75a37cbe7362d751a7a2639c07efc87f to your computer and use it in GitHub Desktop.
Unregister all service workers in Safari
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple & convinient way to remove all service workers registered for specific web page | |
// Useful when working with PWA | |
// Paste code below to the console, it should return Promise | |
const getRidOfAllServiceWorkers = async () => { | |
const registry = await navigator.serviceWorker.getRegistrations() | |
for (const entry of registry) { | |
entry.unregister() | |
} | |
} | |
getRidOfAllServiceWorkers(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment