Skip to content

Commit cee078e

Browse files
committed
fix(cache): Request scheme 'chrome-extension' is unsupported
1 parent 2913deb commit cee078e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js13kpwa/sw.js

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ self.addEventListener('install', (e) => {
4040

4141
// Fetching content using Service Worker
4242
self.addEventListener('fetch', (e) => {
43+
// Cache http and https only, skip unsupported chrome-extension:// and file://...
44+
if (!(
45+
e.request.url.startsWith('http:') || e.request.url.startsWith('https:')
46+
)) {
47+
return;
48+
}
49+
4350
e.respondWith((async () => {
4451
const r = await caches.match(e.request);
4552
console.log(`[Service Worker] Fetching resource: ${e.request.url}`);

0 commit comments

Comments
 (0)