From 62ebedc5f9f26b3411d65a87e17520f41553e47c Mon Sep 17 00:00:00 2001 From: Rostyslav Nihrutsa Date: Tue, 21 Oct 2025 11:54:38 +0300 Subject: [PATCH] fix: handle exceptions when checking for Firefox compatibility --- src/InjectCssV3.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/InjectCssV3.ts b/src/InjectCssV3.ts index d30d30d..8ccc941 100644 --- a/src/InjectCssV3.ts +++ b/src/InjectCssV3.ts @@ -33,8 +33,11 @@ export default class extends AbstractInjectCss { // Firefox does not support `documentIds` in the target // getBrowserInfo is only available in firefox - // @ts-expect-error - const isFirefox = !!browser().runtime.getBrowserInfo; + let isFirefox = false; + try { + // @ts-expect-error + isFirefox = !!browser().runtime.getBrowserInfo; + } catch (_e) {} if (!isFirefox) { const documentIds = this.documentIds;