mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 19:53:43 +00:00
fix(safari): add a bespoke implementation for reloadExtension (#12326)
This commit is contained in:
@@ -1053,14 +1053,6 @@ export default class MainBackground {
|
|||||||
|
|
||||||
const systemUtilsServiceReloadCallback = async () => {
|
const systemUtilsServiceReloadCallback = async () => {
|
||||||
await this.taskSchedulerService.clearAllScheduledTasks();
|
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();
|
BrowserApi.reloadExtension();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -439,6 +439,12 @@ export class BrowserApi {
|
|||||||
* Handles reloading the extension using the underlying functionality exposed by the browser API.
|
* Handles reloading the extension using the underlying functionality exposed by the browser API.
|
||||||
*/
|
*/
|
||||||
static reloadExtension() {
|
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();
|
return chrome.runtime.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user