Discord Benachrichigung, PWA zum teil implementiert
This commit is contained in:
1 parent
b82adc93c7
commit
dae99a0b76
716 files changed
+128101
-21
No files matched your search
@@ -0,0 +1,23 @@
|
||||
const CACHE_NAME = "whopays-cache-v1";
|
||||
const URLS_TO_CACHE = [
|
||||
"/",
|
||||
"/index.html",
|
||||
"/style.css",
|
||||
"/script.js"
|
||||
];
|
||||
|
||||
self.addEventListener("install", event => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE_NAME).then(cache => {
|
||||
return cache.addAll(URLS_TO_CACHE);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", event => {
|
||||
event.respondWith(
|
||||
caches.match(event.request).then(response => {
|
||||
return response || fetch(event.request);
|
||||
})
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user