From 8fedcefb4b9411ab8f6b1694d28ce5ac063d6368 Mon Sep 17 00:00:00 2001 From: Caleb Fultz Date: Tue, 20 Aug 2024 23:58:03 -0400 Subject: [PATCH] Changed service-worker.js to sw.js --- sw.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 sw.js diff --git a/sw.js b/sw.js new file mode 100644 index 0000000..b159467 --- /dev/null +++ b/sw.js @@ -0,0 +1,24 @@ +self.addEventListener('install', (event) => { + event.waitUntil( + caches.open('mtg-csv-generator-v1').then((cache) => { + return cache.addAll([ + '/', + '/index.html', + '/styles.css', + '/app.js', + '/manifest.json', + '/icon.png', + '/cash-money.mp3', + '/randomWords.js' + ]); + }) + ); +}); + +self.addEventListener('fetch', (event) => { + event.respondWith( + caches.match(event.request).then((response) => { + return response || fetch(event.request); + }) + ); +});