30 lines
640 B
JavaScript
30 lines
640 B
JavaScript
let CACHE_NAME = 'workavdenture-cache-dev';
|
|
let urlsToCache = [
|
|
'/'
|
|
];
|
|
|
|
self.addEventListener('install', function(event) {
|
|
// Perform install steps
|
|
event.waitUntil(
|
|
caches.open(CACHE_NAME)
|
|
.then((cache) => {
|
|
return cache.addAll(urlsToCache);
|
|
})
|
|
);
|
|
});
|
|
|
|
self.addEventListener('fetch', (event) => {
|
|
//never cache data will be stored in dev mode
|
|
});
|
|
|
|
self.addEventListener('wait', function(event) {
|
|
//TODO wait
|
|
});
|
|
|
|
self.addEventListener('update', function(event) {
|
|
//TODO update
|
|
});
|
|
|
|
self.addEventListener('beforeinstallprompt', (e) => {
|
|
//TODO change prompt
|
|
}); |