1importScripts('https://push.esputnik.com/service-worker.js'); 2 3var ver = "v1.0"; 4 5self.addEventListener('install', function(t) { 6 t.waitUntil( 7 caches.open(ver) 8 .then(function(cache) { 9 return cache.addAll([ 10 "/offline/" 11 ]); 12 }) 13 ); 14}); 15 16self.addEventListener('activate', function(t) { 17 t.waitUntil(caches.keys().then(function(t) { 18 return Promise.all(t.map(function(t) { 19 if (-1 === ver.indexOf(t)) { 20 return caches.delete(t); 21 } 22 })) 23 })) 24}); 25 26self.addEventListener('fetch', function(t) { 27 // Always bypass for range requests, due to browser bugs 28 if (t.request.headers.has('range')) return; 29 t.respondWith( 30 caches.match(t.request) 31 .then(function(response) { 32 return response || fetch(t.request); 33 }) 34 .catch(function() { 35 return caches.match('/offline/'); 36 }) 37 ); 38});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.