heaventaker/public/service-worker.js
Daniel Bulant 5f6bdcfab6 Death GIF
2021-02-24 10:30:20 +01:00

44 lines
No EOL
1.4 KiB
JavaScript

self.addEventListener('install', function (event) {
event.waitUntil(
caches.open("main").then(function (cache) {
return cache.addAll(
[
"/",
"/global.css",
"/times.woff2",
"/icon.png",
"/build/bundle.css",
"/build/bundle.js",
"/sound/success.wav",
"/sound/thought_patterns.m4a",
"/sprite/backg.webp",
"/sprite/button1.webp",
"/sprite/button2.webp",
"/sprite/death1.webp",
"/sprite/death2.webp",
"/sprite/death3.webp",
"/sprite/death4.webp",
"/sprite/michael_happy.webp",
"/sprite/michael_normal.webp",
"/sprite/michael_wings.webp",
"/sprite/uriel_bat.webp",
"/sprite/uriel_normal.webp",
"/sprite/uriel_side_happy.webp",
"/sprite/uriel_side_normal.webp",
]
);
})
);
});
self.addEventListener('fetch', function (event) {
event.respondWith(
caches.match(event.request).then(function (response) {
return response || fetch(event.request);
})
);
});