mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-25 16:59:17 +01:00
[PM-5887] Refactor WebCryptoFunction to Remove Usage of the window Object in the Background Script (#7749)
This commit is contained in:
parent
c037b1dbbe
commit
7629652a47
@ -326,7 +326,7 @@ export default class MainBackground {
|
||||
? new BrowserMessagingPrivateModeBackgroundService()
|
||||
: new BrowserMessagingService();
|
||||
this.logService = new ConsoleLogService(false);
|
||||
this.cryptoFunctionService = new WebCryptoFunctionService(window);
|
||||
this.cryptoFunctionService = new WebCryptoFunctionService(self);
|
||||
this.storageService = new BrowserLocalStorageService();
|
||||
this.secureStorageService = new BrowserLocalStorageService();
|
||||
this.memoryStorageService =
|
||||
|
@ -12,10 +12,10 @@ export class WebCryptoFunctionService implements CryptoFunctionService {
|
||||
private subtle: SubtleCrypto;
|
||||
private wasmSupported: boolean;
|
||||
|
||||
constructor(win: Window | typeof global) {
|
||||
this.crypto = typeof win.crypto !== "undefined" ? win.crypto : null;
|
||||
constructor(globalContext: Window | typeof global) {
|
||||
this.crypto = typeof globalContext.crypto !== "undefined" ? globalContext.crypto : null;
|
||||
this.subtle =
|
||||
!!this.crypto && typeof win.crypto.subtle !== "undefined" ? win.crypto.subtle : null;
|
||||
!!this.crypto && typeof this.crypto.subtle !== "undefined" ? this.crypto.subtle : null;
|
||||
this.wasmSupported = this.checkIfWasmSupported();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user