fast-calorie/public/sw.js

36 lines
610 B
JavaScript
Raw Normal View History

2020-09-19 21:38:26 +00:00
const CACHE_NAME = "version-1";
const CACHE_FILES = [
"/", "index.html", "404.html",
"/css/styles.css"];
const self = this;
self.addEventListener("install", function(e) {
e.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
console.log('caches opened');
return cache.addAll(CACHE_FILES);
})
)
});
self.addEventListener("fetch", function() {
});
self.addEventListener("sync", function() {
});
self.addEventListener("push", function() {
});
self.addEventListener("activate", function() {
});
self.addEventListener("message", function() {
});