service-worker.js (244B)
1 // Responds to '/clientId' with the request's clientId. 2 self.addEventListener('fetch', e => { 3 if (new URL(e.request.url).pathname === '/clientId') { 4 e.respondWith(new Response(JSON.stringify({clientId: e.clientId}))); 5 return; 6 } 7 });