From 1bf8abaee467b6afdbae3d3b423d6338fcd29f67 Mon Sep 17 00:00:00 2001 From: Sathwik Hejamady Bhat Date: Mon, 27 Apr 2026 08:20:52 +0530 Subject: [PATCH 1/2] fix: detect script injection API before calling it --- src/handleSubmit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handleSubmit.ts b/src/handleSubmit.ts index ba2b684..fb083d2 100644 --- a/src/handleSubmit.ts +++ b/src/handleSubmit.ts @@ -111,7 +111,7 @@ export const handleSubmit = async ( focused: true, }); - if (typeof browser !== 'undefined') { + if (typeof browser !== 'undefined' && typeof browser.tabs?.executeScript === 'function') { await browser.tabs.executeScript(tab.id, { file: '/dist/injectedScript.js', }); From 44e39997b98d30bb405b38d958a4ffc4c1efe968 Mon Sep 17 00:00:00 2001 From: Divyanshu Agrawal Date: Thu, 30 Apr 2026 19:44:41 +0530 Subject: [PATCH 2/2] Fix formatting. --- src/handleSubmit.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/handleSubmit.ts b/src/handleSubmit.ts index fb083d2..e81e07f 100644 --- a/src/handleSubmit.ts +++ b/src/handleSubmit.ts @@ -111,7 +111,10 @@ export const handleSubmit = async ( focused: true, }); - if (typeof browser !== 'undefined' && typeof browser.tabs?.executeScript === 'function') { + if ( + typeof browser !== 'undefined' && + typeof browser.tabs?.executeScript === 'function' + ) { await browser.tabs.executeScript(tab.id, { file: '/dist/injectedScript.js', });