From 9d250dc01dda6929a70775b16d6a2ae54e94b599 Mon Sep 17 00:00:00 2001 From: Eugene Fox Date: Thu, 8 May 2025 06:59:55 +0300 Subject: [PATCH] fix: MAX_CAPTURE_VISIBLE_TAB_CALLS_PER_SECOND exceeded --- entrypoints/background.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/entrypoints/background.ts b/entrypoints/background.ts index 48d5ead..7884e5c 100644 --- a/entrypoints/background.ts +++ b/entrypoints/background.ts @@ -77,6 +77,9 @@ export default defineBackground(() => if (!tab.url || tab.status !== "complete" || !tab.active) return; + if (graphicsCache[tab.url]?.capture || graphicsCache[tab.url]?.capture === null) + return; + try { // We use chrome here because polyfill throws uncatchable errors for some reason @@ -92,7 +95,14 @@ export default defineBackground(() => }; } } - catch { } + catch + { + graphicsCache[tab.url] = { + capture: null!, + preview: graphicsCache[tab.url]?.preview, + icon: graphicsCache[tab.url]?.icon + }; + } }; setInterval(() =>