mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +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:
@@ -163,6 +163,10 @@ export abstract class BrowserPlatformUtilsService implements PlatformUtilsServic
|
|||||||
* the view is open.
|
* the view is open.
|
||||||
*/
|
*/
|
||||||
async isViewOpen(): Promise<boolean> {
|
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"));
|
return Boolean(await BrowserApi.sendMessageWithResponse("checkVaultPopupHeartbeat"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user