[PM-11519] `browser` global reference triggering an error when sending an extension message (#10819)

This commit is contained in:
Cesar Gonzalez 2024-08-30 08:59:04 -05:00 committed by GitHub
parent f44b7b361d
commit 361f90a488
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ export async function sendExtensionMessage(
command: string,
options: Record<string, any> = {},
): Promise<any> {
if (typeof browser !== "undefined") {
if (typeof browser?.runtime?.sendMessage !== "undefined") {
return browser.runtime.sendMessage({ command, ...options });
}