diff --git a/src/background/commands.background.ts b/src/background/commands.background.ts index 625eb4cd67..463862852a 100644 --- a/src/background/commands.background.ts +++ b/src/background/commands.background.ts @@ -20,7 +20,7 @@ export default class CommandsBackground { } async init() { - if (this.isSafari || this.isVivaldi) { + if (this.isVivaldi) { BrowserApi.messageListener('commands.background', async (msg: any, sender: any, sendResponse: any) => { if (msg.command === 'keyboardShortcutTriggered' && msg.shortcut) { await this.processCommand(msg.shortcut, sender); diff --git a/src/background/main.background.ts b/src/background/main.background.ts index d2138dd96a..2b2ddd8c58 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -155,7 +155,7 @@ export default class MainBackground { async () => { if (this.nativeMessagingBackground != null) { const promise = this.nativeMessagingBackground.getResponse(); - + try { await this.nativeMessagingBackground.send({command: 'biometricUnlock'}); } catch (e) { diff --git a/src/background/runtime.background.ts b/src/background/runtime.background.ts index 685b4a5dff..c6964bc232 100644 --- a/src/background/runtime.background.ts +++ b/src/background/runtime.background.ts @@ -4,7 +4,6 @@ import { CipherView } from 'jslib/models/view/cipherView'; import { LoginUriView } from 'jslib/models/view/loginUriView'; import { LoginView } from 'jslib/models/view/loginView'; -import { AuthService } from 'jslib/abstractions/auth.service'; import { AutofillService } from '../services/abstractions/autofill.service'; import BrowserPlatformUtilsService from '../services/browserPlatformUtils.service'; import { CipherService } from 'jslib/abstractions/cipher.service'; @@ -12,17 +11,13 @@ import { ConstantsService } from 'jslib/services/constants.service'; import { EnvironmentService } from 'jslib/abstractions/environment.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { NotificationsService } from 'jslib/abstractions/notifications.service'; -import { PopupUtilsService } from '../popup/services/popup-utils.service'; -import { StateService } from 'jslib/abstractions/state.service'; import { StorageService } from 'jslib/abstractions/storage.service'; -import { SyncService } from 'jslib/abstractions/sync.service'; import { SystemService } from 'jslib/abstractions/system.service'; import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service'; import { BrowserApi } from '../browser/browserApi'; import MainBackground from './main.background'; -import { NativeMessagingBackground } from './nativeMessaging.background'; import { Analytics } from 'jslib/misc'; import { Utils } from 'jslib/misc/utils'; @@ -31,7 +26,6 @@ export default class RuntimeBackground { private runtime: any; private autofillTimeout: any; private pageDetailsToAutoFill: any[] = []; - private isSafari: boolean; private onInstalledReason: string = null; constructor(private main: MainBackground, private autofillService: AutofillService, @@ -40,15 +34,12 @@ export default class RuntimeBackground { private analytics: Analytics, private notificationsService: NotificationsService, private systemService: SystemService, private vaultTimeoutService: VaultTimeoutService, private environmentService: EnvironmentService) { - this.isSafari = this.platformUtilsService.isSafari(); - this.runtime = this.isSafari ? {} : chrome.runtime; + this.runtime = chrome.runtime; // onInstalled listener must be wired up before anything else, so we do it in the ctor - if (!this.isSafari) { - this.runtime.onInstalled.addListener((details: any) => { - this.onInstalledReason = details.reason; - }); - } + this.runtime.onInstalled.addListener((details: any) => { + this.onInstalledReason = details.reason; + }); } async init() { @@ -388,20 +379,6 @@ export default class RuntimeBackground { } private async checkOnInstalled() { - if (this.isSafari) { - const installedVersion = await this.storageService.get(ConstantsService.installedVersionKey); - if (installedVersion == null) { - this.onInstalledReason = 'install'; - } else if (BrowserApi.getApplicationVersion() !== installedVersion) { - this.onInstalledReason = 'update'; - } - - if (this.onInstalledReason != null) { - await this.storageService.save(ConstantsService.installedVersionKey, - BrowserApi.getApplicationVersion()); - } - } - setTimeout(async () => { if (this.onInstalledReason != null) { if (this.onInstalledReason === 'install') { diff --git a/src/browser/safariApp.ts b/src/browser/safariApp.ts index 3c9b887a1d..b78f799396 100644 --- a/src/browser/safariApp.ts +++ b/src/browser/safariApp.ts @@ -19,14 +19,13 @@ export class SafariApp { } static sendMessageToApp(command: string, data: any = null, resolveNow = false): Promise { - debugger; if (!BrowserApi.isSafariApi) { return Promise.resolve(null); } return new Promise((resolve) => { const now = new Date(); const messageId = now.getTime().toString() + '_' + Math.floor(Math.random() * Number.MAX_SAFE_INTEGER); - (browser as any).runtime.sendNativeMessage("com.bitwarden.desktop", { + (browser as any).runtime.sendNativeMessage('com.bitwarden.desktop', { id: messageId, command: command, data: data, @@ -51,7 +50,6 @@ export class SafariApp { } if ((message.id == null || message.id === '') && message.command === 'app_message') { try { - debugger; const msg = JSON.parse(message.data); SafariApp.sendMessageToListeners(msg, { id: 'app_message', diff --git a/src/popup/accounts/two-factor.component.ts b/src/popup/accounts/two-factor.component.ts index 194d6c137d..3395aae848 100644 --- a/src/popup/accounts/two-factor.component.ts +++ b/src/popup/accounts/two-factor.component.ts @@ -63,7 +63,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent { return; } - if (!isSafari && this.selectedProviderType === TwoFactorProviderType.Email && + if (this.selectedProviderType === TwoFactorProviderType.Email && this.popupUtilsService.inPopup(window)) { const confirmed = await this.platformUtilsService.showDialog(this.i18nService.t('popup2faCloseMessage'), null, this.i18nService.t('yes'), this.i18nService.t('no')); diff --git a/src/popup/components/pop-out.component.html b/src/popup/components/pop-out.component.html index 2f14e7c0cb..1c34a1c762 100644 --- a/src/popup/components/pop-out.component.html +++ b/src/popup/components/pop-out.component.html @@ -1,4 +1,4 @@ - + diff --git a/src/popup/components/pop-out.component.ts b/src/popup/components/pop-out.component.ts index 40e02c6906..df9ceba57f 100644 --- a/src/popup/components/pop-out.component.ts +++ b/src/popup/components/pop-out.component.ts @@ -22,8 +22,7 @@ export class PopOutComponent implements OnInit { ngOnInit() { if (this.show) { - this.show = !this.platformUtilsService.isSafari(); - if (this.show && this.popupUtilsService.inSidebar(window) && this.platformUtilsService.isFirefox()) { + if (this.popupUtilsService.inSidebar(window) && this.platformUtilsService.isFirefox()) { this.show = false; } } diff --git a/src/popup/vault/current-tab.component.html b/src/popup/vault/current-tab.component.html index 4fe67ae9b2..0d4181f5cb 100644 --- a/src/popup/vault/current-tab.component.html +++ b/src/popup/vault/current-tab.component.html @@ -1,5 +1,5 @@
-
+