From 7e9d2f00ebd51f9f6333b16b3a72a69c541c0a92 Mon Sep 17 00:00:00 2001 From: Lucca Hellriegel Date: Wed, 21 Dec 2022 22:47:01 +0100 Subject: [PATCH] add check for global ext api before starting auth-sync --- src/authentication/background/auth-sync.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/authentication/background/auth-sync.ts b/src/authentication/background/auth-sync.ts index 67e7637f25..b819e4b497 100644 --- a/src/authentication/background/auth-sync.ts +++ b/src/authentication/background/auth-sync.ts @@ -38,7 +38,14 @@ function addListener( expectedOrigins: string[], ) { //@ts-ignore next-line - chrome.runtime.onMessageExternal.addListener( + const base = chrome || browser + + if (!base) { + return + } + + //@ts-ignore next-line + base.runtime.onMessageExternal.addListener( (message, sender, runtimeSendResponse) => { const messageObj = getMessage(message, sender, expectedOrigins) if (!messageObj) {