diff --git a/src/popup/services/services.module.ts b/src/popup/services/services.module.ts index 89df33a18a..4ef57fa482 100644 --- a/src/popup/services/services.module.ts +++ b/src/popup/services/services.module.ts @@ -65,12 +65,14 @@ function getBgService(service: string) { }; } +const isPrivateMode = BrowserApi.getBackgroundPage() == null; + const stateService = new StateService(); const messagingService = new BrowserMessagingService(); -const searchService = new PopupSearchService(getBgService('searchService')(), +const searchService = isPrivateMode ? null : new PopupSearchService(getBgService('searchService')(), getBgService('cipherService')(), getBgService('consoleLogService')(), getBgService('i18nService')()); -const passwordRepromptService = new PasswordRepromptService(getBgService('i18nService')(), +const passwordRepromptService = isPrivateMode ? null : new PasswordRepromptService(getBgService('i18nService')(), getBgService('cryptoService')(), getBgService('platformUtilsService')()); export function initFactory(platformUtilsService: PlatformUtilsService, i18nService: I18nService, storageService: StorageService, @@ -84,7 +86,7 @@ export function initFactory(platformUtilsService: PlatformUtilsService, i18nServ window.document.body.classList.add('body-sm'); } - if (BrowserApi.getBackgroundPage() != null) { + if (!isPrivateMode) { await stateService.save(ConstantsService.disableFaviconKey, await storageService.get(ConstantsService.disableFaviconKey));