From 420a28c2246a696d1dea136c599f6b69f116a61f Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 29 Jul 2023 16:46:28 -0400 Subject: [PATCH] fix: add missing typeof check --- src/kernel/queries.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kernel/queries.ts b/src/kernel/queries.ts index e4c37a0..fa9678b 100644 --- a/src/kernel/queries.ts +++ b/src/kernel/queries.ts @@ -32,9 +32,9 @@ declare global { declare var browser: any; -const IS_EXTENSION_BG = window.location.pathname.includes( - "_generated_background_page.html", -); +const IS_EXTENSION_BG = + typeof window !== "undefined" && + window.location.pathname.includes("_generated_background_page.html"); const IS_EXTENSION_ENV = typeof window !== "undefined" && window.browser?.runtime?.id;