From 83229e9c67efd6fbabeba08588ba2802eaa4cccd Mon Sep 17 00:00:00 2001 From: robin Date: Mon, 22 Dec 2025 10:46:50 +0100 Subject: [PATCH] fix: ignore non-http schemes in service worker to prevent cache error --- public/sw.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/sw.js b/public/sw.js index d0c4438..b6f5b07 100644 --- a/public/sw.js +++ b/public/sw.js @@ -118,6 +118,12 @@ self.addEventListener('message', (event) => { // 🚀 FETCH: Offline-First Strategy self.addEventListener('fetch', (event) => { + // 🛡️ SECURITY/STABILITY: Only process http/https schemes. + // Prevents "Failed to execute 'put' on 'Cache': Request scheme 'chrome-extension' is unsupported" + if (!event.request.url.startsWith('http')) { + return; + } + const url = new URL(event.request.url); // CRITICAL: Bypass Auth/API/Supabase early and COMPLETELY.