mirror of
https://github.com/bitwarden/browser
synced 2026-02-13 23:13:36 +00:00
add alert message for top-layer hijack scenarios
This commit is contained in:
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user