1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

attach/read container service to window

This commit is contained in:
Kyle Spearrin
2018-01-07 00:15:12 -05:00
parent a387d8f7d0
commit fd931c23d1
4 changed files with 42 additions and 11 deletions

View File

@@ -56,6 +56,7 @@ export default class MainBackground {
passwordGenerationService: PasswordGenerationService;
totpService: TotpService;
autofillService: AutofillService;
containerService: ContainerService;
onUpdatedRan: boolean;
onReplacedRan: boolean;
@@ -83,7 +84,7 @@ export default class MainBackground {
this.storageService = new BrowserStorageService(this.platformUtilsService);
this.i18nService = i18nService(this.platformUtilsService);
this.constantsService = new ConstantsService(this.i18nService, this.platformUtilsService);
this.cryptoService = ContainerService.cryptoService = new CryptoService(this.storageService,
this.cryptoService = new CryptoService(this.storageService,
this.storageService);
this.tokenService = new TokenService(this.storageService);
this.appIdService = new AppIdService(this.storageService);
@@ -107,6 +108,7 @@ export default class MainBackground {
this.totpService = new TotpService(this.storageService);
this.autofillService = new AutofillService(this.cipherService, this.tokenService,
this.totpService, this.utilsService, this.platformUtilsService);
this.containerService = new ContainerService(this.cryptoService, this.platformUtilsService);
// Other fields
this.sidebarAction = (typeof opr !== 'undefined') && opr.sidebarAction ?
@@ -125,6 +127,8 @@ export default class MainBackground {
}
async bootstrap() {
this.containerService.attachToWindow(window);
await this.commandsBackground.init();
await this.contextMenusBackground.init();
await this.idleBackground.init();