1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-11 14:48:46 +01:00

fix(safari): add a bespoke implementation for reloadExtension (#12326)

This commit is contained in:
Addison Beck 2024-12-10 06:28:42 -05:00 committed by GitHub
parent 02c65fd1b8
commit b046c4965d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 8 deletions

View File

@ -1053,14 +1053,6 @@ 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

@ -439,6 +439,12 @@ export class BrowserApi {
* Handles reloading the extension using the underlying functionality exposed by the browser API.
*/
static reloadExtension() {
// 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
if (this.isSafariApi) {
self.location.reload();
}
return chrome.runtime.reload();
}