Skip to content

fix: invert fill/press_key priority — native events first, CDP as fallback#5

Open
JADRT22 wants to merge 1 commit into
Agent360dk:mainfrom
JADRT22:fix/react-input-event-priority
Open

fix: invert fill/press_key priority — native events first, CDP as fallback#5
JADRT22 wants to merge 1 commit into
Agent360dk:mainfrom
JADRT22:fix/react-input-event-priority

Conversation

@JADRT22

@JADRT22 JADRT22 commented Jul 10, 2026

Copy link
Copy Markdown

Problem

browser_fill and browser_press_key don't work on React, Angular, or Vue SPAs (GitHub issue forms, AI Studio, Meta Ads). Text appears visually but framework onChange/onInput listeners never fire.

Root Cause

background.js used Chrome Debugger Protocol Input.insertText as the primary method. CDP typing bypasses React's synthetic event system — CDP returns ok silently, so the native fallback (nativeInputValueSetter + dispatchEvent) never runs.

Fix

Invert the priority: try safeExecuteScriptnativeInputValueSetter FIRST (dispatches proper input/change events), fall back to CDP only when CSP blocks script execution.

Same fix for both CSS-selector and text-selector fill paths, and for browser_press_key.

Verification

After fix, browser_fill returns "method": "native" on React SPAs — input events properly dispatched, framework registers the value. CSP-heavy pages (GitHub, Google) still work via CDP fallback.

Closes #4

…lback

browser_fill and browser_press_key used Chrome Debugger Protocol (CDP)
Input.insertText as primary method, which bypasses React/Angular/Vue
synthetic event systems. CDP returns ok silently but onChange/onInput
listeners never fire on SPA frameworks.

Fix: try nativeInputValueSetter + dispatchEvent via safeExecuteScript
FIRST (properly triggers framework events), fall back to CDP only when
CSP blocks the script execution.
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.

browser_fill/browser_press_key fail on React SPAs — CDP typing doesn't trigger events

1 participant