Options to keep upload_file and fill_form from clicking or pressing keys beyond their target
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- tooling
Research direction
The upload fallback is in build/src/tools/input.js: when handle.uploadFile() throws, it calls waitForFileChooser() and then handle.asLocator().click(). The fill_form path goes through Locator.fill, which uses ElementHandle.type for values under typingThreshold. Done means an opt-in way to disable the click fallback so upload_file only targets <input type=file>, with the maintainers agreeing on the option shape first. Check the tool's tests before changing behavior.
Written by the indexing model from the issue text.
Description
We run chrome-devtools-mcp (1.10.1) behind a policy layer for an agent that fills job-application forms and must never submit them. Two behaviors make that hard to guarantee at the tool level:
1. upload_file clicks its target when a direct upload fails. In build/src/tools/input.js, if handle.uploadFile() throws, the tool falls back to waitForFileChooser() plus handle.asLocator().click(). If an agent passes the uid of a non-file element by mistake, for example a Submit button, the fallback clicks it. We currently ship a patch that removes the fallback. Would you accept an option to turn it off, for example a server flag (--no-upload-chooser-fallback) or a tool parameter, so that upload_file only ever targets an actual <input type=file>?
2. fill_form types short values as real keystrokes. For text inputs, Locator.fill types values shorter than Puppeteer's typingThreshold (100) with ElementHandle.type, and Keyboard.type maps \n/\r to Enter and \t to Tab. A value like "5\n" therefore presses Enter, and in a single-line field that submits the form (implicit submission); a Tab moves focus elsewhere first. We now reject control characters in short values before forwarding, but a built-in option would help every caller: either set values directly without key events, or refuse control characters in typed values. Toggles are clicked by design, which is fine; we'd just like key events not to depend on value length.
Happy to send a PR for either if you agree on the shape.
- Dominant language
- TypeScript
- Stars
- 59.8k
- Forks
- 4.8k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 162
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ChromeDevTools/chrome-devtools-mcp
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
Maintainers usually reply within 1 day
-
`evaluate_script` `sourcePath` http(s) URLs are mangled into `file://` pathsMay be free again A pull request for this issue was closed without being merged. Opencollecting-feedback
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3453 · 3 comments ·
Maintainers usually reply within 1 day
-
collecting-feedback feature
Difficulty 2/5 Half a day Newbie friendliness 76/100
ChromeDevTools/chrome-devtools-mcp#3225 · 3 comments ·
Maintainers usually reply within 1 day
-
confirmed p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#2947 · 1 comment ·
Maintainers usually reply within 1 day
-
Project Migration: Moving to devtools-frontendPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
ChromeDevTools/chrome-devtools-mcp#3648 ·
Maintainers usually reply within 1 day
All issues in ChromeDevTools/chrome-devtools-mcp
Similar issues
-
bug from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nightly-labs/openbot#21303 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ADORSYS-GIS/CoopData#282 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OHDSI/Data2Evidence#3816 ·
Maintainers usually reply within 3 days
-
`ovsx verify` fails for a version older than the 100 newest of an extensionPossibly taken @trivikr claimed this today. Opencli
Difficulty 2/5 1-3 hours Newbie friendliness 81/100
eclipse-openvsx/openvsx#2482 · 2 comments ·
Maintainers usually reply within 1 day
-
bug builder-vite hmr sev:S3
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
storybookjs/storybook#37965 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day