Skip to content

fix(trace): resolve iframe URLs in trace snapshot CLI#40589

Open
Skn0tt wants to merge 1 commit intomicrosoft:mainfrom
Skn0tt:fix-40533
Open

fix(trace): resolve iframe URLs in trace snapshot CLI#40589
Skn0tt wants to merge 1 commit intomicrosoft:mainfrom
Skn0tt:fix-40533

Conversation

@Skn0tt
Copy link
Copy Markdown
Member

@Skn0tt Skn0tt commented May 4, 2026

Summary

  • The trace snapshot HTTP server hardcoded the top-level pageId and routed /snapshot without a trailing slash, so iframe sub-frame requests returned the parent page snapshot and the renderer kept concatenating frame paths.
  • Mirror the trace-viewer service worker: route /snapshot/, parse the page-or-frame id from the path, and pass the full URL as the snapshot cache key.

Fixes #40533

The `trace snapshot` HTTP server hardcoded the top-level pageId for
every request and routed `/snapshot` (no trailing slash), so iframe
sub-frame requests returned the parent page's snapshot and the
renderer's iframe rewrite kept concatenating frame paths instead of
finding the prefix. Mirror the trace-viewer service worker: route
`/snapshot/`, parse the page-or-frame id from the path, and pass the
full URL as the snapshot cache key.

Fixes microsoft#40533
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Test results for "MCP"

2 failed
❌ [chrome] › mcp/autowait.spec.ts:19 › racy navigation destroys context @mcp-windows-latest-chrome
❌ [chrome] › mcp/cli-session.spec.ts:259 › older client with newer daemon - list shows incompatible warning @mcp-windows-latest-chrome

6877 passed, 1025 skipped


Merge workflow run.

const searchParams = url.searchParams;
searchParams.set('name', snapshotKey);
const snapshotResponse = snapshotServer.serveSnapshot(pageId, searchParams, '/snapshot');
const snapshotResponse = snapshotServer.serveSnapshot(pageOrFrameId, searchParams, url.href);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very likely going to explode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CLI trace snapshot hangs in infinite loop due to chaotic iframe path concatenation (+ Feature Request: Trace Sanitization)

2 participants