forked from d8ahazard/Phlex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
service-worker.js
77 lines (76 loc) · 3 KB
/
service-worker.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
importScripts('/js/cache-polyfill.js');
self.addEventListener('install', function(e) {
e.waitUntil(
caches.open('phlex').then(function(cache) {
console.log("opening caches?");
return cache.addAll([
'/',
'/css/font/Roboto-Black.ttf',
'/css/font/Roboto-BlackItalic.ttf',
'/css/font/Roboto-Bold.ttf',
'/css/font/Roboto-BoldItalic.ttf',
'/css/font/Roboto-Italic.ttf',
'/css/font/Roboto-Light.ttf',
'/css/font/Roboto-LightItalic.ttf',
'/css/font/Roboto-Medium.ttf',
'/css/font/Roboto-MediumItalic.ttf',
'/css/font/Roboto-Regular.ttf',
'/css/font/Roboto-Thin.ttf',
'/css/font/Roboto-ThinItalic.ttf',
'/css/font/MaterialIcons.woff2',
'/css/bootstrap.min.css',
'/css/bootstrap-dialog.css',
'/css/bootstrap-grid.min.css',
'/css/bootstrap-ie8.css',
'/css/bootstrap-material-design.min.css',
'/css/dark.css',
'/css/font-awesome.min.css',
'/css/fonts.css',
'/css/main.css',
'/css/main_max_400.css',
'/css/main_max_600.css',
'/css/main_min_600.css',
'/css/main_min_2000.css',
'/css/material.css',
'/css/ripples.min.css',
'/css/snackbar.min.css',
'/img/android-icon-36x36.png',
'/img/android-icon-48x48.png',
'/img/android-icon-72x72.png',
'/img/android-icon-96x96.png',
'/img/android-icon-144x144.png',
'/img/android-icon-192x192.png',
'/img/android-icon-384x384.png',
'/img/android-icon-512x512.png',
'/img/apple-icon.png',
'/img/avatar.png',
'/img/favicon.ico',
'/img/phlex.png',
'/js/arrive.min.js',
'/js/bootstrap.min.js',
'/js/bootstrap-dialog.js',
'/js/clipboard.min.js',
'/js/ie10-viewport-bug-workaround.js',
'/js/jquery.simpleWeather.min.js',
'/js/jquery-3.2.1.min.js',
'/js/login.js',
'/js/main.js',
'/js/material.min.js',
'/js/nouislider.min.js',
'/js/ripples.min.js',
'/js/run_prettify.js',
'/js/snackbar.min.js',
'/js/swiped.min.js',
'/js/tether.min.js'
]);
})
);
});
self.addEventListener('fetch', function(event) {
console.log(event.request.url);
event.respondWith(
caches.match(event.request).then(function(response) {
return response || fetch(event.request);
})
);
});