Skip to content

fix(browser): add cross-origin frame enumeration fallback - #2279

Open
YishanCoding wants to merge 4 commits into
jackwener:mainfrom
YishanCoding:agent/fix-cross-origin-frame-fallback
Open

fix(browser): add cross-origin frame enumeration fallback#2279
YishanCoding wants to merge 4 commits into
jackwener:mainfrom
YishanCoding:agent/fix-cross-origin-frame-fallback

Conversation

@YishanCoding

@YishanCoding YishanCoding commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • preserve DOM snapshot [F#] order for cross-origin iframes
  • lazily fall back from Page.getFrameTree to current-tab-owned Target.getTargets(type=iframe) candidates
  • fail closed with frame_enumeration_mismatch for missing, ambiguous, cross-tab, or stale iframe identity
  • route eval --frame through the same resolved target

Safety

  • fallback runs only when the normal frame tree misses a DOM-observed frame
  • candidates must have a CDP parentId chain reaching the current tab target
  • duplicate URL/name matches are rejected
  • snapshot iframe element identity/order is revalidated before resolution

Tests

  • npx vitest run --project extension: 105 passed
  • npx vitest run --project unit src/browser/dom-snapshot.test.ts: 34 passed
  • npm run typecheck: 0 errors
  • npm run typecheck --prefix extension: 0 errors
  • npm test: 6743 passed, 1 failed, 1 skipped

The one full-suite failure is unchanged from the pre-change baseline and unrelated: clis/huodongxing/events.test.js > filters Huodongxing loose date results by parsed event date overlap; expected the tomorrow event plus range/same-day, but received only range/same-day.

Validation used mock CDP tests only; no real browser or Judge.me page was opened.

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.

1 participant