1'use strict'; 2 3self.addEventListener('install', () => { 4 // Register self as the primary service worker 5 self.skipWaiting(); 6}); 7 8self.addEventListener('activate', (event) => { 9 // Take responsibility over existing clients from old service worker 10 event.waitUntil(self.clients.claim()); 11}); 12 13self.addEventListener('fetch', function (event) { 14 // This is the code that ignores post requests 15 // https://github.com/NodeBB/NodeBB/issues/9151 16 // https://github.com/w3c/ServiceWorker/issues/1141 17 // https://stackoverflow.com/questions/54448367/ajax-xmlhttprequest-progress-monitoring-doesnt-work-with-service-workers 18 if (event.request.method === 'POST') { 19 return; 20 } 21 22 event.respondWith(caches.match(event.request).then(function (response) { 23 if (!response) { 24 return fetch(event.request); 25 } 26 27 return response; 28 })); 29});
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.