diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 9579fb2be8..f54f1de1dd 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -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(); }; diff --git a/apps/browser/src/popup/app.component.ts b/apps/browser/src/popup/app.component.ts index 477152fff8..12d5b109c2 100644 --- a/apps/browser/src/popup/app.component.ts +++ b/apps/browser/src/popup/app.component.ts @@ -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