1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

[PM-5189] Implementing a set threshold for the maximum depth for which we are willing to calculate sub frame offsets

This commit is contained in:
Cesar Gonzalez
2024-06-12 17:40:41 -05:00
parent 6754afb6d6
commit 61fea36604
3 changed files with 3 additions and 3 deletions

View File

@@ -1073,7 +1073,7 @@ export class OverlayBackground implements OverlayBackgroundInterface {
const parentFrameIds = new Set();
subFrameOffsetsForTab.forEach((subFrameOffsetData) =>
subFrameOffsetData.parentFrameIds.forEach((parentFrameId) =>
subFrameOffsetData?.parentFrameIds.forEach((parentFrameId) =>
parentFrameIds.add(parentFrameId),
),
);

View File

@@ -16,4 +16,4 @@ export const RedirectFocusDirection = {
Next: "next",
} as const;
export const MAX_SUB_FRAME_DEPTH = 10;
export const MAX_SUB_FRAME_DEPTH = 8;

View File

@@ -1060,7 +1060,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
const subFrameData: SubFrameDataFromWindowMessage = event.data.subFrameData;
subFrameData.subFrameDepth++;
if (subFrameData.subFrameDepth > MAX_SUB_FRAME_DEPTH) {
if (subFrameData.subFrameDepth >= MAX_SUB_FRAME_DEPTH) {
void this.sendExtensionMessage("destroyAutofillInlineMenuListeners", { subFrameData });
return;
}