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:
parent
02c65fd1b8
commit
b046c4965d
@ -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();
|
||||
};
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user