mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
use chrome.runtime.reload
This commit is contained in:
@@ -179,7 +179,7 @@ export default class MainBackground {
|
|||||||
this.storageService, this.appIdService);
|
this.storageService, this.appIdService);
|
||||||
this.systemService = new SystemService(this.storageService, this.lockService,
|
this.systemService = new SystemService(this.storageService, this.lockService,
|
||||||
this.messagingService, this.platformUtilsService, () => {
|
this.messagingService, this.platformUtilsService, () => {
|
||||||
window.location.reload(true);
|
BrowserApi.reloadExtension(window, false);
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -287,4 +287,12 @@ export class BrowserApi {
|
|||||||
return chrome.i18n.getUILanguage();
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,8 +113,8 @@ export class AppComponent implements OnInit {
|
|||||||
properties: { label: msg.label },
|
properties: { label: msg.label },
|
||||||
});
|
});
|
||||||
} else if (msg.command === 'reloadProcess') {
|
} else if (msg.command === 'reloadProcess') {
|
||||||
window.location.reload(true);
|
BrowserApi.reloadExtension(window, true);
|
||||||
} else {
|
} else {
|
||||||
msg.webExtSender = sender;
|
msg.webExtSender = sender;
|
||||||
this.broadcasterService.send(msg);
|
this.broadcasterService.send(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user