User:Thundercraft5/sw.js

// Add any test code here. // DO NOT SUBMIT TO JSRT! /* global self, Request */ /* jshint undef:true, esversion: 6 */

self.addEventListener('fetch', event => { // ignore:line	let { request: { url }, request } = event;	url = new URL(url);	if (url.pathname.match(/^\/@.*\.[mc]?js$/)) {		url = new URL(url);		url.searchParams.append("action", "raw");		url.searchParams.append("ctype", "javascript");		event.respondWith(fetch(new Request(url, { ...request }))); 	} });

self.addEventListener('activate', event => {	console.log(event); });

self.addEventListener('install', event => {	console.log(event);	});