User:Thundercraft5/CodeFiddle.js/sw.js

/* jshint esversion: 6 */ console.log(self);

self.addEventListener('fetch', async e => {// jshint ignore:line	self.clients.matchAll({ includeUncontrolled: true, type: 'window', }).then(clients => { if (clients && clients.length) { clients[0].postMessage({				type: "requestLog",				request: e.request,			}); }	});

event.respondWith(fetch(e.request)); e; }); // jshint ignore:line