forked from yuameshi/PhiCommunity-Bak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sw.js
94 lines (94 loc) · 3.23 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
const cacheFileList = [
'/assets/audio/Exit.mp3',
'/assets/audio/Pause.mp3',
'/assets/audio/selectSongItem.mp3',
'/assets/audio/Start.mp3',
'/assets/css/fonts/Exo-Regular.otf',
'/assets/css/fonts/fonts.css',
'/assets/css/fonts/Source Han Sans & Saira Hybrid-Regular.ttf',
'/assets/images/A15A.svg',
'/assets/images/AppIcon.png',
'/assets/images/AppIcon.svg',
'/assets/images/Avatar.svg',
'/assets/images/B15B.svg',
'/assets/images/Back.svg',
'/assets/images/C15C.svg',
'/assets/images/ElementSqare.Half.Size.png',
'/assets/images/ElementSqare.Half.Size.webp',
'/assets/images/ElementSqare.png',
'/assets/images/ElementSqare.webp',
'/assets/images/F15F.svg',
'/assets/images/phi15phi.svg',
'/assets/images/Restart.svg',
'/assets/images/Resume.svg',
'/assets/images/S15S.svg',
'/assets/images/Settings.svg',
'/assets/images/showgirl_Half.png',
'/assets/images/showgirl.png',
'/assets/images/Sort.svg',
'/assets/images/Tick.svg',
'/assets/images/Title.svg',
'/assets/images/V15FC.svg',
'/assets/images/V15V.svg',
'/chapterSelect/ChapterSelect0.mp3',
'/LevelOver/LevelOver.mp3',
'/settings/calibrate.mp3',
'/tapToStart/TapToStart.mp3',
'/whilePlaying/assets/oldui/clickRaw.png',
'/whilePlaying/assets/oldui/Drag.png',
'/whilePlaying/assets/oldui/Drag2HL.png',
'/whilePlaying/assets/oldui/Flick.png',
'/whilePlaying/assets/oldui/Flick2HL.png',
'/whilePlaying/assets/oldui/HoldBody.png',
'/whilePlaying/assets/oldui/HoldEnd.png',
'/whilePlaying/assets/oldui/Tap.png',
'/whilePlaying/assets/oldui/Tap2.png',
'/whilePlaying/assets/oldui/Tap2HL.png',
'/whilePlaying/assets/playerFirendlyNote/FlickHL.png',
'/whilePlaying/assets/playerFirendlyNote/HoldHeadHL.png',
'/whilePlaying/assets/playerFirendlyNote/HoldHL.png',
'/whilePlaying/assets/playerFirendlyNote/TapHL.png',
'/whilePlaying/assets/0.png',
'/whilePlaying/assets/Back.svg',
'/whilePlaying/assets/Drag.ogg',
'/whilePlaying/assets/Drag.png',
'/whilePlaying/assets/DragHL.png',
'/whilePlaying/assets/Flick.ogg',
'/whilePlaying/assets/Flick.png',
'/whilePlaying/assets/FlickHL.png',
'/whilePlaying/assets/hitGood.png',
'/whilePlaying/assets/hitPerfect.png',
'/whilePlaying/assets/Hold.png',
'/whilePlaying/assets/HoldEnd.png',
'/whilePlaying/assets/HoldHead.png',
'/whilePlaying/assets/HoldHeadHL.png',
'/whilePlaying/assets/HoldHL.png',
'/whilePlaying/assets/JudgeLine.png',
'/whilePlaying/assets/mute.ogg',
'/whilePlaying/assets/oggmented-bundle.js',
'/whilePlaying/assets/Pause.png',
'/whilePlaying/assets/ProgressBar.png',
'/whilePlaying/assets/Restart.svg',
'/whilePlaying/assets/Resume.svg',
'/whilePlaying/assets/SongNameBar.png',
'/whilePlaying/assets/stackblur.min.js',
'/whilePlaying/assets/stackblur.min.js.map',
'/whilePlaying/assets/Tap.ogg',
'/whilePlaying/assets/Tap.png',
'/whilePlaying/assets/Tap2.png',
'/whilePlaying/assets/TapHL.png',
];
self.addEventListener('fetch', function (e) {
e.respondWith(
caches.match(e.request).then((response) => response || fetch(e.request))
);
});
self.addEventListener('install', function (e) {
console.log('[Service Worker] Install');
e.waitUntil(
caches.open('phi-static-cache').then(function (cache) {
console.log('[Service Worker] Caching all: static assets');
return cache.addAll(cacheFileList);
})
);
});