[PM-7747] add timeout to safari sendMessageWithResponse (#9082)

* add timeout to safari sendMessageWithResponse

* change to query views instead of sending message
This commit is contained in:
Jake Fink 2024-05-09 10:54:05 -04:00
parent af6a63c10b
commit f0ed9a6fac
No known key found for this signature in database
GPG Key ID: FD482F8453480035
1 changed files with 4 additions and 0 deletions

View File

@ -163,6 +163,10 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic
* the view is open.
*/
async isViewOpen(): Promise<boolean> {
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"));
}