diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 3988b3748c..00dc3e3ebc 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -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 = diff --git a/libs/common/src/platform/services/web-crypto-function.service.ts b/libs/common/src/platform/services/web-crypto-function.service.ts index fb0bf33b64..fd0763714a 100644 --- a/libs/common/src/platform/services/web-crypto-function.service.ts +++ b/libs/common/src/platform/services/web-crypto-function.service.ts @@ -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(); }