-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsw.js
More file actions
66 lines (63 loc) · 2.02 KB
/
Copy pathsw.js
File metadata and controls
66 lines (63 loc) · 2.02 KB
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
let CACHE_NAME = 'static-v1';
self.addEventListener('install', function (event) {
event.waitUntil(
caches.open(CACHE_NAME).then(function (cache) {
return cache.addAll([
'/',
'index',
'tradutor',
'referencias',
'ajuda',
'tutorials',
'contato',
'404',
'/view/paginas/header.html',
'/view/paginas/footer.html',
'/css/footer.css',
'/css/header.css',
'/css/pagina.css',
'/css/responsividade.css',
'/images/logo-72.png',
'/images/logo-192.png',
'/images/logo-512.png',
'/images/logo.png',
'/images/fundo9.jpeg',
'/images/facebook.png',
'/images/copyright.png',
'/images/github1.png',
'/images/home.png',
'/images/linkedin.png',
'/images/membro1.jpg',
'/images/membro2.jpg',
'/images/menu-sand.png',
'/images/404.gif',
'/files/legendas.json',
'/files/linguagens.json',
'/js/carregarAjuda.js',
'/js/carregarTutorials.js',
'/js/limpar.js',
]);
})
)
});
self.addEventListener('activate', function activator(event) {
event.waitUntil(
caches.keys().then(function (keys) {
return Promise.all(keys
.filter(function (key) {
return key.indexOf(CACHE_NAME) !== 0;
})
.map(function (key) {
return caches.delete(key);
})
);
})
);
});
self.addEventListener('fetch', function (event) {
event.respondWith(
caches.match(event.request).then(function (cachedResponse) {
return cachedResponse || fetch(event.request);
})
);
});