Add COOP/COEP for worker.js file.

This commit is contained in:
ArthurSonzogni 2022-07-09 19:58:11 +02:00
parent d5b1899290
commit d6da30a518
No known key found for this signature in database
GPG Key ID: 41D98248C074CD6C

View File

@ -2,8 +2,10 @@
self.addEventListener("install", () => self.skipWaiting());
self.addEventListener("activate", e => e.waitUntil(self.clients.claim()));
self.addEventListener("fetch", e => {
if (e.request.mode != 'navigate')
if (e.request.mode != 'navigate' &&
!e.request.url.includes(".worker.js")) {
return;
}
e.respondWith((async () => {
const response = await fetch(e.request);