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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user