From 361f90a488465ee7f8a32a15904eb659988fbd25 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Fri, 30 Aug 2024 08:59:04 -0500 Subject: [PATCH] [PM-11519] `browser` global reference triggering an error when sending an extension message (#10819) --- apps/browser/src/autofill/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/browser/src/autofill/utils/index.ts b/apps/browser/src/autofill/utils/index.ts index d62013b161..ad9fa3a9a8 100644 --- a/apps/browser/src/autofill/utils/index.ts +++ b/apps/browser/src/autofill/utils/index.ts @@ -105,7 +105,7 @@ export async function sendExtensionMessage( command: string, options: Record = {}, ): Promise { - if (typeof browser !== "undefined") { + if (typeof browser?.runtime?.sendMessage !== "undefined") { return browser.runtime.sendMessage({ command, ...options }); }