From 8b68c21e39e7b5b0fbb9791c7d306d536a6d37ad Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Tue, 10 Dec 2024 03:15:22 -0300 Subject: [PATCH] fix: throwing when injecting content in the hello page (#1696) --- .changeset/orange-points-laugh.md | 5 +++++ packages/app/src/systems/CRX/scripts/executeContentScript.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/orange-points-laugh.md diff --git a/.changeset/orange-points-laugh.md b/.changeset/orange-points-laugh.md new file mode 100644 index 000000000..e6f6417e9 --- /dev/null +++ b/.changeset/orange-points-laugh.md @@ -0,0 +1,5 @@ +--- +"fuels-wallet": patch +--- + +Fix exception when injecting content in the hello page diff --git a/packages/app/src/systems/CRX/scripts/executeContentScript.ts b/packages/app/src/systems/CRX/scripts/executeContentScript.ts index b06001818..292c29b19 100644 --- a/packages/app/src/systems/CRX/scripts/executeContentScript.ts +++ b/packages/app/src/systems/CRX/scripts/executeContentScript.ts @@ -34,6 +34,7 @@ export async function executeContentScript() { } function injectContentScript(tabId: number) { + const env = process.env?.NODE_ENV; chrome.scripting .executeScript({ target: { tabId: tabId, allFrames: true }, @@ -41,7 +42,7 @@ function injectContentScript(tabId: number) { injectImmediately: true, }) .catch((err) => { - if (process.env?.NODE_ENV === 'development') { + if (env === 'development') { console.warn(err); } });