2019-11-12 18:43:32 +01:00
|
|
|
importScripts('/js/cache-polyfill.js');
|
2019-11-04 11:58:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
self.addEventListener('install', function(e) {
|
2019-11-12 16:35:23 +01:00
|
|
|
self.skipWaiting();
|
2019-11-04 11:58:46 +01:00
|
|
|
e.waitUntil(
|
|
|
|
caches.open('meritkollen').then(function(cache) {
|
|
|
|
return cache.addAll([
|
2019-11-04 12:56:38 +01:00
|
|
|
'/',
|
|
|
|
'/index.html',
|
|
|
|
'/Ekonomi',
|
|
|
|
'/Estet',
|
|
|
|
'/Natur',
|
|
|
|
'/Samhäll',
|
|
|
|
'/Teknik',
|
|
|
|
'/Kontakt',
|
2019-11-11 00:07:36 +01:00
|
|
|
'/css/main.css',
|
|
|
|
'/img/background.jpg',
|
|
|
|
'/img/background85.webp',
|
2019-11-08 02:17:07 +01:00
|
|
|
'/img/favicon/manifest.json',
|
|
|
|
'/img/favicon/android-chrome-192x192.png',
|
|
|
|
'/img/favicon/favicon-32x32.png',
|
|
|
|
'/img/favicon/favicon-16x16.png',
|
|
|
|
'/img/favicon/favicon.ico',
|
2019-11-12 17:24:37 +01:00
|
|
|
'/js/calcscript.js',
|
|
|
|
'/js/changeall.js',
|
|
|
|
'/js/jquery.js',
|
|
|
|
'/js/material.js',
|
|
|
|
'/js/materialize.js',
|
2019-11-08 02:17:07 +01:00
|
|
|
'/js/modernizer-webp.js',
|
2019-11-12 17:24:37 +01:00
|
|
|
'/js/smallScript.js',
|
|
|
|
'/js/softscrollscript.js',
|
|
|
|
'/js/sparabetyg.js',
|
2019-11-04 12:56:38 +01:00
|
|
|
'https://fonts.googleapis.com/icon?family=Material+Icons',
|
2019-11-04 22:37:26 +01:00
|
|
|
'https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2',
|
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Regular.woff2',
|
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Regular.woff',
|
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Medium.woff2',
|
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Medium.woff',
|
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Light.woff2',
|
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Light.woff',
|
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Thin.woff2',
|
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/fonts/roboto/Roboto-Thin.woff',
|
2019-11-04 21:19:39 +01:00
|
|
|
'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.2/css/materialize.min.css',
|
2019-11-04 11:58:46 +01:00
|
|
|
]);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
self.addEventListener('fetch', function(event) {
|
2019-11-04 22:37:26 +01:00
|
|
|
//console.log(event.request.url);
|
2019-11-04 11:58:46 +01:00
|
|
|
event.respondWith(
|
|
|
|
caches.match(event.request).then(function(response) {
|
|
|
|
return response || fetch(event.request);
|
|
|
|
})
|
|
|
|
);
|
2019-11-08 02:17:07 +01:00
|
|
|
});
|