mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
sweet alert dialog implementation
This commit is contained in:
@@ -115,9 +115,9 @@ export default class MainBackground {
|
||||
constructor() {
|
||||
// Services
|
||||
this.utilsService = new UtilsService();
|
||||
this.platformUtilsService = new BrowserPlatformUtilsService();
|
||||
this.messagingService = new BrowserMessagingService();
|
||||
this.platformUtilsService = new BrowserPlatformUtilsService(this.messagingService);
|
||||
const delayi18nLoad = this.platformUtilsService.isEdge() || this.platformUtilsService.isSafari() ? 1000 : 0;
|
||||
this.messagingService = new BrowserMessagingService(this.platformUtilsService);
|
||||
this.storageService = new BrowserStorageService(this.platformUtilsService, false);
|
||||
this.secureStorageService = new BrowserStorageService(this.platformUtilsService, true);
|
||||
this.i18nService = i18nService(this.platformUtilsService);
|
||||
@@ -161,7 +161,8 @@ export default class MainBackground {
|
||||
|
||||
// Background
|
||||
this.runtimeBackground = new RuntimeBackground(this, this.autofillService, this.cipherService,
|
||||
this.platformUtilsService, this.storageService, this.i18nService, this.analytics);
|
||||
this.platformUtilsService as BrowserPlatformUtilsService, this.storageService, this.i18nService,
|
||||
this.analytics);
|
||||
this.tabsBackground = new TabsBackground(this, this.platformUtilsService);
|
||||
this.commandsBackground = new CommandsBackground(this, this.passwordGenerationService,
|
||||
this.platformUtilsService, this.analytics);
|
||||
|
||||
@@ -11,7 +11,6 @@ import { Analytics } from 'jslib/misc';
|
||||
|
||||
import {
|
||||
CipherService,
|
||||
PlatformUtilsService,
|
||||
StorageService,
|
||||
} from 'jslib/abstractions';
|
||||
|
||||
@@ -20,6 +19,7 @@ import { BrowserApi } from '../browser/browserApi';
|
||||
import MainBackground from './main.background';
|
||||
|
||||
import { AutofillService } from '../services/abstractions/autofill.service';
|
||||
import BrowserPlatformUtilsService from '../services/browserPlatformUtils.service';
|
||||
|
||||
export default class RuntimeBackground {
|
||||
private runtime: any;
|
||||
@@ -29,7 +29,7 @@ export default class RuntimeBackground {
|
||||
private onInstalledReason: string = null;
|
||||
|
||||
constructor(private main: MainBackground, private autofillService: AutofillService,
|
||||
private cipherService: CipherService, private platformUtilsService: PlatformUtilsService,
|
||||
private cipherService: CipherService, private platformUtilsService: BrowserPlatformUtilsService,
|
||||
private storageService: StorageService, private i18nService: any, private analytics: Analytics) {
|
||||
this.isSafari = this.platformUtilsService.isSafari();
|
||||
this.runtime = this.isSafari ? safari.application : chrome.runtime;
|
||||
@@ -90,6 +90,9 @@ export default class RuntimeBackground {
|
||||
case 'openPopup':
|
||||
await this.main.openPopup();
|
||||
break;
|
||||
case 'showDialogResolve':
|
||||
this.platformUtilsService.resolveDialogPromise(msg.dialogId, msg.confirmed);
|
||||
break;
|
||||
case 'bgGetDataForTab':
|
||||
await this.getDataForTab(sender.tab, msg.responseCommand);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user