Skip to content

bsk fill / bsk press ignore the OOPIF session and type into the parent frame #438

Open

Description

@Li-john1021

Prerequisites

Background

Refs for cross-frame nodes carry cdpSessionId, and resolveBackendNode puts that on cdpTarget.sessionId. DOM.focus already goes through cdpRunnerForTarget / sendToTarget. Fill and press then type with deps.cdp.send(tabId, "Input.*"), which always hits the root session.

Evidence

  • Focus path uses nodeCdp (apps/extension/src/tools/interaction.ts around the fill DOM.focus call).
  • Typing uses root deps.cdp.send for Input.dispatchKeyEvent / Input.insertText in fill, and the same for press key events.
  • Same-process iframe tests create contentDocument frames (no child sessionId), so they cannot catch this.
  • Mouse input on the root session is intentional (viewport coordinates). Keyboard / insertText are focus-routed.

How a user hits it

  1. bsk observe a page whose text field lives in a cross-origin iframe (card widget, IdP login, embedded editor).
  2. bsk fill @eN --value "…" focuses the child node, then Input.insertText hits the parent. Verification fails with fill_value_mismatch, or the parent page receives the text.
  3. bsk press Enter --ref @eN reports success even when the child document never saw the key.

Expected

Input.* for a ref that carries cdpSessionId should use the same child session as DOM.focus.

I have a small fix + unit test ready and can open a PR if this sounds right to maintainers.

Activity

  1. wcy12378 commented on Oct 24, 2026

    @wcy12378
    Contributor

    I'd like to take this. Agreed with the analysis: Input.* for a ref carrying cdpSessionId should route through the same child session that DOM.focus already uses (cdpRunnerForTarget/sendToTarget), for both fill and press. Plan: route the typing calls in apps/extension/src/tools/interaction.ts through the target session, add unit regressions for both fill-into-OOPIF and press-into-OOPIF, and link the PR here.

  2. Li-john1021 commented on Oct 26, 2026

    @Li-john1021
    Author

    Follow-up from #439: I ran a Chrome 155 cross-site OOPIF CDP repro (localhost parent → 127.0.0.1 child). After child-session DOM.focus, root-session Input.insertText / Enter already land in the iframe field on main, so I could not show “fails on main, passes with the routing change.” Details and the Tab keyUp regression note are on the PR comment. Suggest closing #439 unless a different environment still reproduces.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions