From 04a63e3f84c06a46cb782953ce1adb397c83cd91 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Fri, 23 May 2025 11:25:09 +0200 Subject: [PATCH] spot: more checks for bg --- spot/entrypoints/background.ts | 3 ++- spot/entrypoints/content/index.tsx | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spot/entrypoints/background.ts b/spot/entrypoints/background.ts index 8dbc6e8bf..633385aa1 100644 --- a/spot/entrypoints/background.ts +++ b/spot/entrypoints/background.ts @@ -943,7 +943,7 @@ export default defineBackground(() => { }); } for (const tab of await chrome.tabs.query({})) { - if (tab.url?.match(/(chrome|chrome-extension):\/\//gi)) { + if (tab.url?.match(/(chrome|chrome-extension):\/\//gi) || !tab.id) { continue; } const res = await browser.scripting.executeScript({ @@ -953,6 +953,7 @@ export default defineBackground(() => { console.log('restoring content at', res) } await checkTokenValidity(); + void initializeOffscreenDocument(); }); void initializeOffscreenDocument(); diff --git a/spot/entrypoints/content/index.tsx b/spot/entrypoints/content/index.tsx index f5e5c4d9d..846a085e2 100644 --- a/spot/entrypoints/content/index.tsx +++ b/spot/entrypoints/content/index.tsx @@ -28,7 +28,6 @@ export default defineContentScript({ append: "first", onMount: (container, s, host) => { Object.assign(host.style, { visibility: "visible", display: "block" }); - return render( () => ( { + ui.remove(); + }); let micResponse: boolean | null = null; const getMicStatus = async () => { return new Promise((res) => {