fix(web): retain CDP scope and request identity during session preparation (#13188)

This commit is contained in:
morluto authored and GitHub committed 2026-11-21 19:05:13 +00:00
1 parent 56838a036c
commit 5c390198f7
4 files changed
+147 -161

No files matched your search

+8 -5
View File
@@ -93,6 +93,14 @@ export const observeCdpSession = async (
context.sessionId,
context.signal,
);
// Page.enable can replay earlier Page history. Observe subsequent events
// before enabling Network so preparation retains new navigation and the
// request identities needed for failures inside the armed window.
removeListener = onCdpTargetEvent(
context.connection,
context.sessionId,
(event) => capture.ingest(event),
);
await context.connection.send(
"Network.enable",
{},
@@ -105,11 +113,6 @@ export const observeCdpSession = async (
context.sessionId,
context.signal,
);
removeListener = onCdpTargetEvent(
context.connection,
context.sessionId,
(event) => capture.ingest(event),
);
// Host wall time marks command dispatch. The returned browser monotonic
// timestamp is the authoritative cutoff for timestamped lifecycle facts.
const armedAt = new Date().toISOString();