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

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