Skip to content

Instantly share code, notes, and snippets.

@neg4n
Created April 26, 2021 20:39
Show Gist options
  • Save neg4n/75a37cbe7362d751a7a2639c07efc87f to your computer and use it in GitHub Desktop.
Save neg4n/75a37cbe7362d751a7a2639c07efc87f to your computer and use it in GitHub Desktop.
Unregister all service workers in Safari
// 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