This repository has been archived on 2023-12-31. You can view files and clone it, but cannot push or open issues or pull requests.
meritkollen/html/sw.js

35 lines
843 B
JavaScript
Raw Normal View History

2019-11-04 11:58:46 +01:00
importScripts('/cache-polyfill.js');
self.addEventListener('install', function(e) {
e.waitUntil(
caches.open('meritkollen').then(function(cache) {
return cache.addAll([
'/',
'/index.html',
'/Ekonomi.php',
'/Estet.php',
'/Natur.php',
'/Samhäll.php',
'/Teknik.php',
'/assets/css/main.min.css',
'/assets/img/background.jpg',
'/assets/js/calcscript.js',
'/assets/js/changeall.js',
'/assets/js/loader.js',
'/assets/js/loader.min.js',
'/assets/js/softscrollscript.js',
'/assets/js/sparabetyg.js',
]);
})
);
});
self.addEventListener('fetch', function(event) {
console.log(event.request.url);
event.respondWith(
caches.match(event.request).then(function(response) {
return response || fetch(event.request);
})
);
});