From 3410aec605c5493b549a677a36bb73fdda65cb6f Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Fri, 23 May 2025 10:13:36 +0200 Subject: [PATCH] spot: close offscreen doc before reinit --- spot/entrypoints/background.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spot/entrypoints/background.ts b/spot/entrypoints/background.ts index b393ca570..8dbc6e8bf 100644 --- a/spot/entrypoints/background.ts +++ b/spot/entrypoints/background.ts @@ -965,13 +965,11 @@ export default defineBackground(() => { (c: { contextType: string }) => c.contextType === "OFFSCREEN_DOCUMENT", ); if (offscreenDocument) { - return; - // TODO: check manifestv3 for reloading context - // try { - // await browser.offscreen.closeDocument(); - // } catch (e) { - // console.trace(e) - // } + try { + await browser.offscreen.closeDocument(); + } catch (e) { + console.error("Spot: error closing old offscreen document", e); + } } try {