-
Notifications
You must be signed in to change notification settings - Fork 2
/
sw.js
23 lines (23 loc) · 897 Bytes
/
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
importScripts('resources/cache-polyfill/cache-polyfill.js');
self.addEventListener('install', function (e) {
e.waitUntil(caches.open('iplocator').then(function (cache) {
return cache.addAll([
'/',
'index.html',
'resources/css/style.css',
'resources/images/icon.svg',
'resources/jquery/jquery.min.js',
'resources/dialog-polyfill/dialog-polyfill.css',
'resources/dialog-polyfill/dialog-polyfill.js',
'resources/js/app.js',
'resources/mdl/material.deep_orange-orange.min.css',
'resources/mdl/material.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);
}));
});