-
Notifications
You must be signed in to change notification settings - Fork 0
/
sw.js
40 lines (30 loc) · 990 Bytes
/
sw.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Imports Cache polyfill to fully support addALl method
importScripts('/group-13-web-app/web-app/cache-polyfill.js');
self.addEventListener('install', function(e) {
e.waitUntil(
caches.open('airhorner').then(function(cache) {
return cache.addAll([
// List of files to cache
'/group-13-web-app',
'/group-13-web-app/index.html',
'/group-13-web-app/css/master.css',
'/group-13-web-app/web-app/manifest.json',
'/group-13-web-app/about.html',
'/group-13-web-app/calculator.html',
'/group-13-web-app/map.html',
'/group-13-web-app/menu.html',
'/group-13-web-app/shopGuide.html',
'/group-13-web-app/advice.html'
]);
})
);
});
// Logs page requests
self.addEventListener('fetch', function(event) {
//console.log(event.request.url);
event.respondWith(
caches.match(event.request).then(function(response) {
return response || fetch(event.request);
})
);
});