mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
utils global
This commit is contained in:
@@ -2,6 +2,8 @@ import { EncryptionType } from '../../enums/encryptionType';
|
||||
|
||||
import { CryptoService } from '../../abstractions/crypto.service';
|
||||
|
||||
import { Utils } from '../../misc/utils';
|
||||
|
||||
export class CipherString {
|
||||
encryptedString?: string;
|
||||
encryptionType?: EncryptionType;
|
||||
@@ -93,11 +95,11 @@ export class CipherString {
|
||||
}
|
||||
|
||||
let cryptoService: CryptoService;
|
||||
const containerService = (window as any).bitwardenContainerService;
|
||||
const containerService = (Utils.global as any).bitwardenContainerService;
|
||||
if (containerService) {
|
||||
cryptoService = containerService.getCryptoService();
|
||||
} else {
|
||||
throw new Error('window.bitwardenContainerService not initialized.');
|
||||
throw new Error('global bitwardenContainerService not initialized.');
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -35,7 +35,7 @@ export class LoginUriView implements View {
|
||||
|
||||
get domain(): string {
|
||||
if (this._domain == null && this.uri != null) {
|
||||
const containerService = (window as any).bitwardenContainerService;
|
||||
const containerService = (Utils.global as any).bitwardenContainerService;
|
||||
if (containerService) {
|
||||
const platformUtilsService: PlatformUtilsService = containerService.getPlatformUtilsService();
|
||||
this._domain = platformUtilsService.getDomain(this.uri);
|
||||
@@ -43,7 +43,7 @@ export class LoginUriView implements View {
|
||||
this._domain = null;
|
||||
}
|
||||
} else {
|
||||
throw new Error('window.bitwardenContainerService not initialized.');
|
||||
throw new Error('global bitwardenContainerService not initialized.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user