|
|
@@ -1,8 +1,6 @@
|
|
|
// This is the "Offline copy of pages" service worker
|
|
|
|
|
|
-// Install stage sets up the index page (home page) in the cache and opens a new cache
|
|
|
-const { self } = window;
|
|
|
-
|
|
|
+// eslint-disable-next-line no-restricted-globals
|
|
|
self.addEventListener('install', event => {
|
|
|
const indexPage = new Request('index.html');
|
|
|
event.waitUntil(
|
|
|
@@ -12,7 +10,7 @@ self.addEventListener('install', event => {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
-// If any fetch fails, it will look for the request in the cache and serve it from there first
|
|
|
+// eslint-disable-next-line no-restricted-globals
|
|
|
self.addEventListener('fetch', event => {
|
|
|
const updateCache = request =>
|
|
|
caches
|