self.addEventListener('install', function(event) { event.waitUntil( caches.open('inknswitch').then(function(cache) { return cache.addAll([ './index.html', './ink.js', './android-icon-36x36.png', './android-icon-48x48.png', './android-icon-72x72.png', './android-icon-96x96.png', './android-icon-144x144.png', './android-icon-192x192.png', './apple-icon-57x57.png', './apple-icon-60x60.png', './apple-icon-72x72.png', './apple-icon-76x76.png', './apple-icon-114x114.png', './apple-icon-120x120.png', './apple-icon-144x144.png', './apple-icon-152x152.png', './apple-icon-180x180.png', './apple-icon-precomposed.png', './apple-icon.png', ]); }) ); }); self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request).then(function(response) { return response || fetch(event.request); }) ); });