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

use chrome.runtime.reload

This commit is contained in:
Kyle Spearrin 2019-03-05 15:05:04 -05:00
parent db8624a6b7
commit 3b6f7bb941
3 changed files with 11 additions and 3 deletions

View File

@ -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();
});

View File

@ -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();
}
}
}

View File

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