diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2018-02-09 21:23:41 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-09 21:23:41 +0530 |
commit | 94f80fea060a3c06c913955b90cd41bb18c922fa (patch) | |
tree | 45dd94602ab745f273c245ecbdc79007e6d3b4cc /sw.js | |
parent | 393a7dfde86a269ebee1e200647e8b3a046d2968 (diff) |
Update sw.js
Diffstat (limited to 'sw.js')
-rw-r--r-- | sw.js | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -24,20 +24,23 @@ return cache.addAll([ ]); +}) -.then(() => self.skipWaiting()); - }) - ) -}); +); -self.addEventListener('activate', event => { - event.waitUntil(self.clients.claim()); }); +self.addEventListener('fetch', function(event) { + +console.log(event.request.url); + +event.respondWith( + +caches.match(event.request).then(function(response) { + +return response || fetch(event.request); + +}) + +); -self.addEventListener('fetch', event => { - event.respondWith( - caches.match(event.request, {ignoreSearch:true}).then(response => { - return response || fetch(event.request); - }) - ); }); |