Source code
Revision control
Copy as Markdown
Other Tools
function handleFetch(event) {
event.respondWith(new Response("intercepted"));
}
self.oninstall = function (event) {
addEventListener("fetch", handleFetch);
self.onfetch = handleFetch;
};
// doesn't set the fetch flag.
addEventListener("push", function () {});
addEventListener("message", function () {});
addEventListener("non-sw-event", function () {});