44 lines
1,007 B
HTML
44 lines
1,007 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Updating...</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<style>
|
|
body {
|
|
font-family: sans-serif;
|
|
padding: 2em;
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Updating App…</h1>
|
|
<p>Please wait while we refresh your version.</p>
|
|
|
|
<script>
|
|
async function clean() {
|
|
// Unregister all SWs
|
|
if ('serviceWorker' in navigator) {
|
|
const regs = await navigator.serviceWorker.getRegistrations();
|
|
for (const reg of regs) {
|
|
await reg.unregister();
|
|
}
|
|
}
|
|
|
|
// Delete all caches
|
|
if ('caches' in window) {
|
|
const keys = await caches.keys();
|
|
for (const key of keys) {
|
|
await caches.delete(key);
|
|
}
|
|
}
|
|
|
|
// Hard reload
|
|
location.href = '/';
|
|
}
|
|
|
|
clean();
|
|
</script>
|
|
</body>
|
|
</html>
|