1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

[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
committed by GitHub
parent da144410e8
commit c69cc37716

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"));
}