From bd360fd4f11bdd373849658608f3ea1777d4b299 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 7 Jan 2026 13:26:44 -0500 Subject: [PATCH] put phish url download on extension install/update behind feature flag --- apps/browser/src/background/runtime.background.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/browser/src/background/runtime.background.ts b/apps/browser/src/background/runtime.background.ts index e4d3c428802..c81ae561025 100644 --- a/apps/browser/src/background/runtime.background.ts +++ b/apps/browser/src/background/runtime.background.ts @@ -7,6 +7,7 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv import { AutofillOverlayVisibility, ExtensionCommand } from "@bitwarden/common/autofill/constants"; import { AutofillSettingsServiceAbstraction } from "@bitwarden/common/autofill/services/autofill-settings.service"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service"; +import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { ProcessReloadServiceAbstraction } from "@bitwarden/common/key-management/abstractions/process-reload.service"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; @@ -434,12 +435,17 @@ export default class RuntimeBackground { if (this.onInstalledReason != null) { // Pre-populate phishing cache on install/update so it's ready when premium user logs in - // This runs in background and doesn't block the user + // Only download if the phishing detection feature flag is enabled if (this.onInstalledReason === "install" || this.onInstalledReason === "update") { - this.logService.debug( - `[RuntimeBackground] Extension ${this.onInstalledReason}: triggering phishing cache pre-population`, + const phishingFlagEnabled = await this.configService.getFeatureFlag( + FeatureFlag.PhishingDetection, ); - this.main.triggerPhishingCacheUpdate(); + if (phishingFlagEnabled) { + this.logService.debug( + `[RuntimeBackground] Extension ${this.onInstalledReason}: triggering phishing cache pre-population`, + ); + this.main.triggerPhishingCacheUpdate(); + } } if (