1 self.addEventListener('fetch', function(event) {
2 if (event.request.url.includes('dummy')) {
3 event.waitUntil(async function() {
4 let destination = new URL(event.request.url).searchParams.get("dest");
5 let client = await self.clients.get(event.clientId);
6 if (event.request.destination == destination) {
7 client.postMessage("PASS");
9 client.postMessage("FAIL");
13 event.respondWith(fetch(event.request));