-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsw.js
36 lines (32 loc) · 1.18 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
// Version 3
self.addEventListener('install', function(e) {
e.waitUntil(
caches.open('playbulb-candle').then(function(cache) {
return cache.addAll([
'/demos/playbulb-candle-ba/',
'/demos/playbulb-candle-ba/index.html',
'/demos/playbulb-candle-ba/styles.css',
'/demos/playbulb-candle-ba/bower_components/gatt-ip-js/gattip.js',
'/demos/playbulb-candle-ba/wb-polyfill.js',
'/demos/playbulb-candle-ba/playbulbCandle.js',
'/demos/playbulb-candle-ba/app.js',
'/demos/playbulb-candle-ba/color-wheel.png',
'/demos/playbulb-candle-ba/code.getmdl.io/1.0.4/material.green-light_green.min.css',
'/demos/playbulb-candle-ba/code.getmdl.io/1.0.4/material.min.js',
'https://fonts.googleapis.com/icon?family=Material+Icons',
]).then(function() {
return self.skipWaiting();
});
})
);
});
self.addEventListener('activate', function(event) {
event.waitUntil(self.clients.claim());
});
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request).then(function(response) {
return response || fetch(event.request);
})
);
});