This commit is contained in:
parent
8ccbe2ebf1
commit
2fbf21eaaf
10
pwa/sw.js
10
pwa/sw.js
@ -4,7 +4,11 @@ const CACHE = "pwabuilder-offline-page";
|
|||||||
|
|
||||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
|
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
|
||||||
|
|
||||||
const offlineFallbackPage = "404";
|
const PRECACHE_ASSETS = [
|
||||||
|
'/',
|
||||||
|
'/404'
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
self.addEventListener("message", (event) => {
|
self.addEventListener("message", (event) => {
|
||||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||||
@ -15,7 +19,7 @@ self.addEventListener("message", (event) => {
|
|||||||
self.addEventListener('install', async (event) => {
|
self.addEventListener('install', async (event) => {
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
caches.open(CACHE)
|
caches.open(CACHE)
|
||||||
.then((cache) => cache.add(offlineFallbackPage))
|
.then((cache) => cache.addAll(PRECACHE_ASSETS))
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -45,7 +49,7 @@ self.addEventListener('fetch', (event) => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
const cache = await caches.open(CACHE);
|
const cache = await caches.open(CACHE);
|
||||||
const cachedResp = await cache.match(offlineFallbackPage);
|
const cachedResp = await cache.match('/404');
|
||||||
return cachedResp;
|
return cachedResp;
|
||||||
}
|
}
|
||||||
})());
|
})());
|
||||||
|
@ -50,7 +50,12 @@
|
|||||||
<script async src="https://umami.woodburn.au/script.js" data-website-id="6a55028e-aad3-481c-9a37-3e096ff75589"></script>
|
<script async src="https://umami.woodburn.au/script.js" data-website-id="6a55028e-aad3-481c-9a37-3e096ff75589"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="page-top" data-bs-spy="scroll" data-bs-target="#mainNav" data-bs-offset="77">{{handshake_scripts | safe}}
|
<body id="page-top" data-bs-spy="scroll" data-bs-target="#mainNav" data-bs-offset="77"><script>
|
||||||
|
if (typeof navigator.serviceWorker !== 'undefined') {
|
||||||
|
navigator.serviceWorker.register('sw.js')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{{handshake_scripts | safe}}
|
||||||
<nav class="navbar navbar-expand-md fixed-top navbar-light" id="mainNav" style="background: var(--bs-navbar-hover-color);">
|
<nav class="navbar navbar-expand-md fixed-top navbar-light" id="mainNav" style="background: var(--bs-navbar-hover-color);">
|
||||||
<div class="container-fluid"><a class="navbar-brand" href="/#">
|
<div class="container-fluid"><a class="navbar-brand" href="/#">
|
||||||
<div style="padding-right: 1em;display: inline-flex;">
|
<div style="padding-right: 1em;display: inline-flex;">
|
||||||
@ -274,12 +279,7 @@ Check them out here!</blockquote><img class="img-fluid" src="/assets/img/pfront.
|
|||||||
ethdomain.addEventListener('click', () => {
|
ethdomain.addEventListener('click', () => {
|
||||||
copyToClipboard(ethdomain);
|
copyToClipboard(ethdomain);
|
||||||
});
|
});
|
||||||
</script>{{custom | safe}}<script>
|
</script>{{custom | safe}}
|
||||||
if (typeof navigator.serviceWorker !== 'undefined') {
|
|
||||||
navigator.serviceWorker.register('sw.js')
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="d-none d-print-none d-sm-none d-md-block d-lg-block d-xl-block d-xxl-block clock" style="padding: 1em;background: #10101039;border-top-right-radius: 10px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" class="fs-2">
|
<div class="d-none d-print-none d-sm-none d-md-block d-lg-block d-xl-block d-xxl-block clock" style="padding: 1em;background: #10101039;border-top-right-radius: 10px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20" fill="none" class="fs-2">
|
||||||
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM11 6C11 5.44772 10.5523 5 10 5C9.44771 5 9 5.44772 9 6V10C9 10.2652 9.10536 10.5196 9.29289 10.7071L12.1213 13.5355C12.5118 13.9261 13.145 13.9261 13.5355 13.5355C13.9261 13.145 13.9261 12.5118 13.5355 12.1213L11 9.58579V6Z" fill="currentColor"></path>
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM11 6C11 5.44772 10.5523 5 10 5C9.44771 5 9 5.44772 9 6V10C9 10.2652 9.10536 10.5196 9.29289 10.7071L12.1213 13.5355C12.5118 13.9261 13.145 13.9261 13.5355 13.5355C13.9261 13.145 13.9261 12.5118 13.5355 12.1213L11 9.58579V6Z" fill="currentColor"></path>
|
||||||
|
Loading…
Reference in New Issue
Block a user