fix(browser): ignore duplicate frame navigations and read block-form source map directives (#546)

This commit is contained in:
morluto
2026-10-05 17:25:16 +08:00
committed by GitHub
parent 84e4361c09
commit 828395d510
6 changed files with 149 additions and 4 deletions
+8 -1
View File
@@ -367,8 +367,15 @@ export const handleFrameNavigated = (
): void => {
const frame = recordValue(params.frame);
if (stringValue(frame?.id) !== state.mainFrameId) return;
state.navigationDuringCapture = true;
const rawUrl = stringValue(frame?.url);
const loaderId = stringValue(frame?.loaderId);
// `frameNavigated` re-fires for a document already reported (same URL and
// loader). Treating that as a navigation aborted a valid capture with
// `target_changed`, which is a false claim that the target moved.
const document = `${String(loaderId ?? "")}\0${String(rawUrl ?? "")}`;
if (state.committedDocument === document) return;
state.committedDocument = document;
state.navigationDuringCapture = true;
if (
isHttpUrl(rawUrl) &&
allowedSanitizedUrl(rawUrl, state.allowedOrigins) === undefined