1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

Add Back Safari Only Handling of Process Reload (#11115)

This commit is contained in:
Justin Baur 2024-09-17 16:58:23 -04:00 committed by GitHub
parent 99ba56785d
commit e8979decae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -1038,6 +1038,14 @@ export default class MainBackground {
const systemUtilsServiceReloadCallback = async () => {
await this.taskSchedulerService.clearAllScheduledTasks();
if (this.platformUtilsService.isSafari()) {
// If we do `chrome.runtime.reload` on safari they will send an onInstalled reason of install
// and that prompts us to show a new tab, this apparently doesn't happen on sideloaded
// extensions and only shows itself production scenarios. See: https://bitwarden.atlassian.net/browse/PM-12298
self.location.reload();
return;
}
BrowserApi.reloadExtension();
};

View File

@ -127,6 +127,12 @@ export class AppComponent implements OnInit, OnDestroy {
this.showNativeMessagingFingerprintDialog(msg);
} else if (msg.command === "showToast") {
this.toastService._showToast(msg);
} else if (msg.command === "reloadProcess") {
if (this.platformUtilsService.isSafari()) {
window.setTimeout(() => {
window.location.reload();
}, 2000);
}
} else if (msg.command === "reloadPopup") {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises