User:Thundercraft5/CodeFiddle.js/sw.js

/* jshint esversion: 6 */ console.log(self); self.addEventListener('fetch', async function(e) {// jshint ignore:line	// Get client and post request data	if (!event.clientId) return;	const client = await clients.get(event.clientId); // jshint ignore:line	if (!client) return;

client.postMessage({		type: "requestLog",		request: e.request,	}); return fetch(e.request); }); // jshint ignore:line