From c69cc377162bf3072039047466a2555c2200cff9 Mon Sep 17 00:00:00 2001 From: Jake Fink Date: Thu, 9 May 2024 10:54:05 -0400 Subject: [PATCH] [PM-7747] add timeout to safari sendMessageWithResponse (#9082) * add timeout to safari sendMessageWithResponse * change to query views instead of sending message --- .../services/platform-utils/browser-platform-utils.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/browser/src/platform/services/platform-utils/browser-platform-utils.service.ts b/apps/browser/src/platform/services/platform-utils/browser-platform-utils.service.ts index 855492521b..4163ca9310 100644 --- a/apps/browser/src/platform/services/platform-utils/browser-platform-utils.service.ts +++ b/apps/browser/src/platform/services/platform-utils/browser-platform-utils.service.ts @@ -163,6 +163,10 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic * the view is open. */ async isViewOpen(): Promise { + if (this.isSafari()) { + // Query views on safari since chrome.runtime.sendMessage does not timeout and will hang. + return BrowserApi.isPopupOpen(); + } return Boolean(await BrowserApi.sendMessageWithResponse("checkVaultPopupHeartbeat")); }