-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsw.js
151 lines (137 loc) · 4.13 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
* See https://goo.gl/2aRDsh
*/
console.log('service-worker.js registered');
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
if (workbox) {
console.log(`Yay! Workbox is loaded also 🎉`);
} else {
console.log(`Boo! Workbox didn't load 😬`);
}
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});
// JQuery library
workbox.routing.registerRoute(
'https://code.jquery.com/jquery-3.4.0.min.js',
new workbox.strategies.StaleWhileRevalidate(),
);
// jQuery UI - Extension library
workbox.routing.registerRoute(
'https://code.jquery.com/ui/1.12.1/jquery-ui.min.js',
new workbox.strategies.StaleWhileRevalidate(),
);
// jQuery UI - Extension library - touch hack library
workbox.routing.registerRoute(
'https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js',
new workbox.strategies.StaleWhileRevalidate(),
);
// Knockout - Sortable - Extension library
workbox.routing.registerRoute(
'https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.1/knockout-min.js',
new workbox.strategies.StaleWhileRevalidate(),
);
// Knockout - Sortable - Extension library
workbox.routing.registerRoute(
'https://cdnjs.cloudflare.com/ajax/libs/knockout-sortable/1.2.0/knockout-sortable.min.js',
new workbox.strategies.StaleWhileRevalidate(),
);
// Bootstrap UI library
workbox.routing.registerRoute(
'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js',
new workbox.strategies.StaleWhileRevalidate(),
);
// Firebase SDK
workbox.routing.registerRoute(
'https://www.gstatic.com/firebasejs/7.13.1/firebase-app.js',
new workbox.strategies.StaleWhileRevalidate(),
);
// Firebase/Firestore SDK
workbox.routing.registerRoute(
'https://www.gstatic.com/firebasejs/7.13.1/firebase-firestore.js',
new workbox.strategies.StaleWhileRevalidate(),
);
// Analytics SDK
// workbox.routing.registerRoute(
// 'https://www.googletagmanager.com/gtag/js?id=G-015ZZ5Y0C7',
// new workbox.strategies.StaleWhileRevalidate(),
// );
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [
{
"url": "app.js",
"revision": "b796cb483b363e0d777b60dbcace4aeb"
},
{
"url": "bootstrap.min.css",
"revision": "8fe70898895271ddc62823321011273a"
},
{
"url": "images/icons/icon-128x128.png",
"revision": "b601f9c8605971ae9a877bc7fbe09653"
},
{
"url": "images/icons/icon-144x144.png",
"revision": "358cc49ae8d739d975e34dc43bf10c5a"
},
{
"url": "images/icons/icon-152x152.png",
"revision": "c06d7f4f4aca8caa8783e1181e4a9e53"
},
{
"url": "images/icons/icon-192x192.png",
"revision": "8b3ab92cbf61607f5d5f5fb9820599e2"
},
{
"url": "images/icons/icon-384x384.png",
"revision": "fbbb0230da177bb52f9237c33257e39a"
},
{
"url": "images/icons/icon-512x512.png",
"revision": "79d797eeff43d58256d89398d7c8f09c"
},
{
"url": "images/icons/icon-72x72.png",
"revision": "855d25ce9f0881cf196eacf81e22873e"
},
{
"url": "images/icons/icon-96x96.png",
"revision": "24c70fd923864b2f5f485a2c733d8110"
},
{
"url": "index.html",
"revision": "9aade009ec2141079c18004fa4ce7494"
},
{
"url": "main.css",
"revision": "38b651e8201466fe1d1b009ae807fd4e"
},
{
"url": "manifest.webmanifest",
"revision": "687166fc8aa941e5f29418814f2ff785"
},
{
"url": "package.json",
"revision": "cecd7e12fb54a1d50aeddd57edc9764c"
},
{
"url": "README.md",
"revision": "949035dc3f334275dd7d81be6ebb2de8"
}
].concat(self.__precacheManifest || []);
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});