-
Notifications
You must be signed in to change notification settings - Fork 0
/
serviceWorker.js
51 lines (49 loc) · 1.23 KB
/
serviceWorker.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
41
42
43
44
45
46
47
48
49
50
51
const staticFeeshDrift = "feesh-drift-v1.1"
const assets = [
"/",
"/index.html",
"/css.css",
"/float.js",
"/icons/icon-36.png",
"/assets/ambient.ogg",
"/assets/rock.png",
"/assets/rock2.png",
"/assets/water1.png",
"/assets/water2.png",
"/assets/water3.png",
"/assets/water4.png",
"/assets/water5.png",
"/assets/water_refl_1.png",
"/assets/water_refl_2.png",
"/assets/feesh1.png",
"/assets/feesh2.png",
"/assets/feesh3.png",
"/assets/feesh4.png",
"/assets/feesh5.png",
"/assets/feesh6.png",
"/assets/feesh7.png",
"/assets/ripple1.png",
"/assets/ripple2.png",
"/assets/ripple3.png",
"/assets/ripple4.png",
"/assets/blank.png",
"/assets/padded1.png",
"/assets/padded2.png",
"/assets/padded3.png",
"/assets/padded4.png",
"/assets/padded5.png",
]
self.addEventListener("install", installEvent => {
installEvent.waitUntil(
caches.open(staticFeeshDrift).then(cache => {
cache.addAll(assets)
})
)
})
self.addEventListener("fetch", fetchEvent => {
fetchEvent.respondWith(
caches.match(fetchEvent.request).then(res => {
return res || fetch(fetchEvent.request)
})
)
})