diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index d91a33c6796..143578bc107 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -2391,6 +2391,9 @@ } } }, + "topLayerHijackWarning": { + "message": "This page is interferring with the Bitwarden experience. The Bitwarden inline menu has been temporarily disabled as a safety measure." + }, "setMasterPassword": { "message": "Set master password" }, diff --git a/apps/browser/src/autofill/overlay/inline-menu/content/autofill-inline-menu-content.service.ts b/apps/browser/src/autofill/overlay/inline-menu/content/autofill-inline-menu-content.service.ts index 7c86e0dbaed..994170ff647 100644 --- a/apps/browser/src/autofill/overlay/inline-menu/content/autofill-inline-menu-content.service.ts +++ b/apps/browser/src/autofill/overlay/inline-menu/content/autofill-inline-menu-content.service.ts @@ -39,8 +39,10 @@ export class AutofillInlineMenuContentService implements AutofillInlineMenuConte private containerElementMutationObserver: MutationObserver; private topLayerRefreshCountWithinTimeThreshold: number = 0; private lastTrackedTopLayerRefreshTimestamp = Date.now(); - // Distinct from preventing inline menu script injection, this is for cases where the page - // is subsequently determined to be risky. + /** + * Distinct from preventing inline menu script injection, this is for cases + * where the page is subsequently determined to be risky. + */ private inlineMenuEnabled = true; private mutationObserverIterations = 0; private mutationObserverIterationsResetTimeout: number | NodeJS.Timeout; @@ -530,6 +532,9 @@ export class AutofillInlineMenuContentService implements AutofillInlineMenuConte // Set inline menu to be off; page is aggressively trying to take top position of top layer this.inlineMenuEnabled = false; void this.checkPageRisks(); + + const warningMessage = chrome.i18n.getMessage("topLayerHijackWarning"); + globalThis.window.alert(warningMessage); } } else { this.lastTrackedTopLayerRefreshTimestamp = now;