// Minimal service worker — required for PWA installability. // No caching: all requests pass through to the network. // Exists solely so browsers recognize the site as installable // (iOS/Android persist camera permissions after "Add to Home Screen"). // // IMPORTANT: /hubs/ (SignalR) requests are excluded from interception entirely. // Service worker fetch() wraps SSE/WebSocket responses in a buffered Response, // which prevents real-time streaming — SignalR handshakes time out as a result. const SKIP_PREFIXES = ['/hubs/', '/Kiosk/PollSession']; self.addEventListener('install', () => self.skipWaiting()); self.addEventListener('activate', e => e.waitUntil(self.clients.claim())); // No fetch interception — all requests handled natively by the browser. // The SW exists solely for PWA installability; calling e.respondWith(fetch(request)) // causes TypeError failures on localhost HTTPS due to certificate trust differences // in the SW context, breaking JS/CSS resource loads.