Unregister all service workers (#598)

- use stretch instead of old-spec fill-available
- unregister service workers on load
This commit is contained in:
Alex Bates
2022-12-08 13:00:00 +00:00
committed by GitHub
parent 453f55ed9c
commit 49f3f7ae80
2 changed files with 13 additions and 1 deletions

View File

@@ -110,7 +110,7 @@ body.no-scroll {
overflow: hidden;
#__next {
height: fill-available;
height: stretch;
height: 100svh;
}
}

View File

@@ -69,6 +69,18 @@ export default function MyApp({ Component, pageProps }) {
}
}, [])
// Unregister all service workers (#593) - temporary until we make a new, better service worker
useEffect(() => {
if ("serviceWorker" in navigator) {
navigator.serviceWorker.getRegistrations().then(registrations => {
for (const registration of registrations) {
registration.unregister()
console.warn("unregistered service worker:", registration)
}
})
}
}, [])
return <Layout>
<Head>
<meta name="theme-color" content={themeColor} />