mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
1bca5888f2
* add pwa files * Added better 512px icon! (#2146) * updated icon Co-authored-by: Estebene <49330942+Estebene@users.noreply.github.com> Co-authored-by: Jack <bartnikjack@gmail.com>
15 lines
371 B
JavaScript
15 lines
371 B
JavaScript
self.addEventListener("install", function (event) {
|
|
event.waitUntil(
|
|
caches.open("sw-cache").then(function (cache) {
|
|
return cache.add("index.html");
|
|
})
|
|
);
|
|
});
|
|
|
|
self.addEventListener("fetch", function (event) {
|
|
event.respondWith(
|
|
caches.match(event.request).then(function (response) {
|
|
return response || fetch(event.request);
|
|
})
|
|
);
|
|
});
|