PageSourceSearch

https://kg.ac.rs/js/service-worker.js

js kg.ac.rs collected 2026-10-01 10:19:28 UTC 876 bytes, 31 lines download raw bytes

1// ============================================================
2//  service-worker.js  —  Univerzitet u Kragujevcu
3// ============================================================
4
5const CACHE_NAME = 'unikg-cache-v1';
6
7self.addEventListener('install', function(event) {
8    self.skipWaiting();
9});
10
11self.addEventListener('activate', function(event) {
12    event.waitUntil(self.clients.claim());
13});
14
15self.addEventListener('fetch', function(event) {
16    var request = event.request;
17
18    if (request.method !== 'GET') return;
19
20    var url = request.url;
21    if (!url.startsWith('http://') && !url.startsWith('https://')) return;
22
23    if (new URL(url).origin !== self.location.origin) return;
24
25    event.respondWith(
26        fetch(request).catch(function() {
27        
28            return new Response('', { status: 503, statusText: 'Service Unavailable' });
29        })
30    );
31});

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.