Repository navigation
Conversation
Fixes the 'Frontend lint, typecheck, tests, build' CI failure: biome check rejected the hand-formatted Page.getLayoutMetrics mock entries in interaction.test.ts and the line-wrapped keyCdp ternary in interaction.ts. Reformatted both files with biome so 'pnpm lint' passes.
|
CI failure root cause: Fix: reformatted both files with biome ( |
|
Thanks for working on this and following up on the CI fixes. I reviewed fc725c9 and would like to hold off on merging until we have a browser-level reproduction of the original issue and address the regressions below. The assumption that sending keyboard input to the root CDP session necessarily types into the main frame does not match the Chromium behavior I checked. Both I compared the actual interaction handlers from main (b63f551) and main with this patch, using a local cross-site iframe in Chrome 155 on macOS:
The new unit tests verify which session receives the calls, but do not establish that the original browser interaction fails or that the change fixes it. They also keep the child session and focus stable throughout the key sequence, which misses these cases. Could you provide a minimal test page, browser/OS version, and steps that fail on main and pass with this change? If the failure depends on background tabs or a particular browser version, please include that setup. My checks do not rule out an environment-specific issue, but the current evidence does not support changing the routing globally. Once we have that reproduction, we can assess a targeted fix and add browser regressions for focus leaving an iframe and an iframe being removed during a key press. For now, I don't think this version is ready to merge. |
Fixes #438
Problem
Refs for cross-frame (OOPIF) nodes carry
cdpSessionId, andDOM.focusalready resolves through that child session (cdpRunnerForTarget/sendToTarget). But the typing that follows —Input.dispatchKeyEvent/Input.insertTextinfill, and the key events inpress— went through the tab-leveldeps.cdp.send, which always hits the root session. Text landed in the main frame while the OOPIF field stayed empty.Mouse events are unaffected:
Input.dispatchMouseEventis viewport-relative and reaches OOPIF content through the composited widget, which is why only the keyboard path is broken.Change
fill: the three typing calls (caret-positioningrawKeyDown/keyUpandInput.insertText) now go through the samenodeCdprunner asDOM.focus.press: key events go through akeyCdprunner — the node's child session when a ref/selector resolved, the root session otherwise (ref-less press keeps its current behavior).cdpRunnerForTargetalready falls back to the tab-level send when the node has no session, so non-OOPIF behavior is identical.Validation
Windows x64, Node 24, pnpm 10.17.0 (
apps/extension):pnpm test src/tools/__tests__/interaction.test.ts→ 129 passed (127 pre-existing + 2 new)routes fill typing into the ref's OOPIF child session: a ref withcdpSessionId— everyInput.*call recorded on the child session viasendToTarget, zero on the rootroutes press key events into the ref's OOPIF child session: all threedispatchKeyEventphases (rawKeyDown/char/keyUp) on the child session, none on the rootinteraction.tsmakes exactly the two new tests fail (typing lands on the root session), confirming they exercise the bugpnpm compile(tsc --noEmit) clean