mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
WIP Safari web extension
This commit is contained in:
@@ -165,8 +165,8 @@ export default class MainBackground {
|
||||
return promise.then((result) => result.response === 'unlocked');
|
||||
}
|
||||
});
|
||||
this.storageService = new BrowserStorageService(this.platformUtilsService);
|
||||
this.secureStorageService = new BrowserStorageService(this.platformUtilsService);
|
||||
this.storageService = new BrowserStorageService();
|
||||
this.secureStorageService = new BrowserStorageService();
|
||||
this.i18nService = new I18nService(BrowserApi.getUILanguage(window));
|
||||
this.cryptoFunctionService = new WebCryptoFunctionService(window, this.platformUtilsService);
|
||||
this.cryptoService = new CryptoService(this.storageService, this.secureStorageService,
|
||||
@@ -249,17 +249,15 @@ export default class MainBackground {
|
||||
this.commandsBackground = new CommandsBackground(this, this.passwordGenerationService,
|
||||
this.platformUtilsService, this.analytics, this.vaultTimeoutService);
|
||||
|
||||
if (!this.isSafari) {
|
||||
this.tabsBackground = new TabsBackground(this);
|
||||
this.contextMenusBackground = new ContextMenusBackground(this, this.cipherService,
|
||||
this.passwordGenerationService, this.analytics, this.platformUtilsService, this.vaultTimeoutService,
|
||||
this.eventService, this.totpService);
|
||||
this.idleBackground = new IdleBackground(this.vaultTimeoutService, this.storageService,
|
||||
this.notificationsService);
|
||||
this.webRequestBackground = new WebRequestBackground(this.platformUtilsService, this.cipherService,
|
||||
this.vaultTimeoutService);
|
||||
this.windowsBackground = new WindowsBackground(this);
|
||||
}
|
||||
this.tabsBackground = new TabsBackground(this);
|
||||
this.contextMenusBackground = new ContextMenusBackground(this, this.cipherService,
|
||||
this.passwordGenerationService, this.analytics, this.platformUtilsService, this.vaultTimeoutService,
|
||||
this.eventService, this.totpService);
|
||||
this.idleBackground = new IdleBackground(this.vaultTimeoutService, this.storageService,
|
||||
this.notificationsService);
|
||||
this.webRequestBackground = new WebRequestBackground(this.platformUtilsService, this.cipherService,
|
||||
this.vaultTimeoutService);
|
||||
this.windowsBackground = new WindowsBackground(this);
|
||||
}
|
||||
|
||||
async bootstrap() {
|
||||
@@ -273,13 +271,11 @@ export default class MainBackground {
|
||||
await this.runtimeBackground.init();
|
||||
await this.commandsBackground.init();
|
||||
|
||||
if (!this.isSafari) {
|
||||
await this.tabsBackground.init();
|
||||
await this.contextMenusBackground.init();
|
||||
await this.idleBackground.init();
|
||||
await this.webRequestBackground.init();
|
||||
await this.windowsBackground.init();
|
||||
}
|
||||
await this.tabsBackground.init();
|
||||
await this.contextMenusBackground.init();
|
||||
await this.idleBackground.init();
|
||||
await this.webRequestBackground.init();
|
||||
await this.windowsBackground.init();
|
||||
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(async () => {
|
||||
@@ -294,7 +290,7 @@ export default class MainBackground {
|
||||
}
|
||||
|
||||
async setIcon() {
|
||||
if (this.isSafari || (!chrome.browserAction && !this.sidebarAction)) {
|
||||
if ((!chrome.browserAction && !this.sidebarAction)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -313,7 +309,7 @@ export default class MainBackground {
|
||||
}
|
||||
|
||||
async refreshBadgeAndMenu(forLocked: boolean = false) {
|
||||
if (this.isSafari || !chrome.windows || !chrome.contextMenus) {
|
||||
if (!chrome.windows || !chrome.contextMenus) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -444,7 +440,7 @@ export default class MainBackground {
|
||||
}
|
||||
|
||||
private async buildContextMenu() {
|
||||
if (this.isSafari || !chrome.contextMenus || this.buildingContextMenu) {
|
||||
if (!chrome.contextMenus || this.buildingContextMenu) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user