mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
remove unecesarry code from service worker
This commit is contained in:
parent
2a53c35df7
commit
a02f42b0a6
@ -9,37 +9,6 @@ const CACHE = "crafty-controller";
|
||||
//This service worker is basically just here to make browsers
|
||||
//accept the PWA. It's not doing much anymore
|
||||
|
||||
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
|
||||
const offlineFallbackPage = "/offline";
|
||||
|
||||
// self.addEventListener("message", (event) => {
|
||||
// console.log(event.data);
|
||||
// if (event.data && event.data.type === "SKIP_WAITING") {
|
||||
// self.skipWaiting();
|
||||
// }
|
||||
// });
|
||||
|
||||
if (workbox.navigationPreload.isSupported()) {
|
||||
workbox.navigationPreload.enable();
|
||||
}
|
||||
|
||||
// self.addEventListener('fetch', (event) => {
|
||||
// if (event.request.mode === 'navigate') {
|
||||
// event.respondWith((async () => {
|
||||
// try {
|
||||
// const preloadResp = await event.preloadResponse;
|
||||
|
||||
// if (preloadResp) {
|
||||
// return preloadResp;
|
||||
// }
|
||||
// const networkResp = await fetch(event.request);
|
||||
// return networkResp;
|
||||
// } catch (error) {
|
||||
|
||||
// const cache = await caches.open(CACHE);
|
||||
// const cachedResp = await cache.match(offlineFallbackPage);
|
||||
// return cachedResp;
|
||||
// }
|
||||
// })());
|
||||
// }
|
||||
// });
|
||||
|
Loading…
Reference in New Issue
Block a user