From a322cc5e2c3f452daec2748aec091806905a1a3a Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Wed, 23 Sep 2026 15:43:41 +0000 Subject: [PATCH] fix: Prevent TypeError from orphaned content script --- src/content/github/file/main.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/content/github/file/main.tsx b/src/content/github/file/main.tsx index 0e81545..46533d7 100644 --- a/src/content/github/file/main.tsx +++ b/src/content/github/file/main.tsx @@ -66,8 +66,17 @@ async function init(): Promise { return main(); } +function isExtensionContextValid(): boolean { + return browser.runtime?.id != null; +} + async function main(): Promise { try { + if (!isExtensionContextValid()) { + print("extension context invalidated, skipping"); + return; + } + if (consent === "none") { // No data consent, do nothing. return;