diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 957a1a2eca..adcac127a0 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -179,7 +179,7 @@ export default class MainBackground { this.storageService, this.appIdService); this.systemService = new SystemService(this.storageService, this.lockService, this.messagingService, this.platformUtilsService, () => { - window.location.reload(true); + BrowserApi.reloadExtension(window, false); return Promise.resolve(); }); diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index d90c61a1d4..d1cd121522 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -287,4 +287,12 @@ export class BrowserApi { return chrome.i18n.getUILanguage(); } } + + static reloadExtension(win: Window, popupWindow: boolean) { + if (BrowserApi.isSafariApi) { + return win.location.reload(true); + } else if (!popupWindow) { + return chrome.runtime.reload(); + } + } } diff --git a/src/popup/app.component.ts b/src/popup/app.component.ts index c80d0bd442..ec48656da7 100644 --- a/src/popup/app.component.ts +++ b/src/popup/app.component.ts @@ -113,8 +113,8 @@ export class AppComponent implements OnInit { properties: { label: msg.label }, }); } else if (msg.command === 'reloadProcess') { - window.location.reload(true); - } else { + BrowserApi.reloadExtension(window, true); + } else { msg.webExtSender = sender; this.broadcasterService.send(msg); }