1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 18:53:29 +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

@@ -1,5 +1,23 @@
import { Abstractions } from '@bitwarden/jslib';
import { CryptoService } from './abstractions/crypto.service';
export default class ContainerService {
static cryptoService: CryptoService = null;
constructor(private cryptoService: CryptoService,
private platformUtilsService: Abstractions.PlatformUtilsService) {
}
attachToWindow(win: any) {
if (!win.BitwardenContainerService) {
win.BitwardenContainerService = this;
}
}
getCryptoService(): CryptoService {
return this.cryptoService;
}
getPlatformUtilsService(): Abstractions.PlatformUtilsService {
return this.platformUtilsService;
}
}