-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathumbrella_sw.js
36 lines (33 loc) · 928 Bytes
/
umbrella_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
// v2.3
self.addEventListener('install', e => {
e.waitUntil(
caches.open('rainfall').then(cache => {
return cache.addAll([
'',
'manifest.json',
'index.html',
'assets/scripts/main.js',
'assets/styles/main.css',
'assets/images/rain.svg',
'assets/fonts/gotham-medium.woff2',
'assets/images/rainfall_144.png',
'assets/images/rainfall_256.png',
'assets/images/rainfall_512.png',
'assets/media/rain.mp3',
'assets/media/thunder.mp3',
'assets/media/window.mp3'
])
.then(() => self.skipWaiting());
})
)
});
self.addEventListener('activate', event => {
event.waitUntil(self.clients.claim());
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request, { ignoreSearch: true }).then(response => {
return response || fetch(event.request);
})
);
});