Description of the bug
Calling upload_file with the uid of an element that opens the file chooser (e.g. a button that calls input.click(), which is how most real-world upload UIs work — the actual <input type="file"> is hidden) crashes the Chrome tab with RESULT_CODE_KILLED_BAD_MESSAGE ("Aw, Snap!"). The browser process kills the renderer, presumably over the file-chooser interception IPC.
Calling upload_file with the uid of the <input type="file"> element itself works correctly (file is set, change event fires).
The tool description explicitly documents the chooser-opening-element case as supported:
The uid of the file input element or an element that will open file chooser on the page from the page content snapshot
The tool response after the crash is misleading — it reports Error: Element with uid X no longer exists on the page. because the whole tab has crashed, so an agent has no way to tell the page died and typically keeps flailing. This has been reproducible for months across projects.
Reproduction
Self-contained repro (no external site needed):
new_page with this URL:
data:text/html,<h1>upload test</h1><input type="file" id="f"><button onclick="document.getElementById('f').click()">Choose via chooser</button><div id="out"></div><script>document.getElementById('f').addEventListener('change',e=>{document.getElementById('out').textContent='GOT: '+e.target.files[0].name})</script>
take_snapshot → note the uid of the button ("Choose via chooser")
upload_file with that button's uid and any local file path
- Tab crashes: "Aw, Snap! RESULT_CODE_KILLED_BAD_MESSAGE". Tool returns
Error: Element with uid <uid> no longer exists on the page.
Control: step 3 with the uid of the <input type="file"> element instead succeeds — snapshot afterwards shows value="upload-test.txt" and StaticText "GOT: upload-test.txt".
Expectation
upload_file on a chooser-opening element intercepts the chooser and sets the file, as documented — or at minimum fails gracefully without killing the renderer, and reports the tab crash rather than "element no longer exists".
MCP configuration
claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest --browserUrl http://172.19.96.1:9222
Connecting from WSL2 to a user-launched Chrome on the Windows host started with --remote-debugging-port=9222 (headful, real profile).
Chrome DevTools MCP version
1.5.0
Chrome version
Chrome/150.0.7871.47 (Windows x64, headful)
Coding agent version
Claude Code 2.1.201
Model version
claude-fable-5
Node version
v22.22.0
Operating system
Windows Subsystem for Linux (WSL)
Description of the bug
Calling
upload_filewith theuidof an element that opens the file chooser (e.g. a button that callsinput.click(), which is how most real-world upload UIs work — the actual<input type="file">is hidden) crashes the Chrome tab withRESULT_CODE_KILLED_BAD_MESSAGE("Aw, Snap!"). The browser process kills the renderer, presumably over the file-chooser interception IPC.Calling
upload_filewith theuidof the<input type="file">element itself works correctly (file is set,changeevent fires).The tool description explicitly documents the chooser-opening-element case as supported:
The tool response after the crash is misleading — it reports
Error: Element with uid X no longer exists on the page.because the whole tab has crashed, so an agent has no way to tell the page died and typically keeps flailing. This has been reproducible for months across projects.Reproduction
Self-contained repro (no external site needed):
new_pagewith this URL:take_snapshot→ note the uid of the button ("Choose via chooser")upload_filewith that button's uid and any local file pathError: Element with uid <uid> no longer exists on the page.Control: step 3 with the uid of the
<input type="file">element instead succeeds — snapshot afterwards showsvalue="upload-test.txt"andStaticText "GOT: upload-test.txt".Expectation
upload_fileon a chooser-opening element intercepts the chooser and sets the file, as documented — or at minimum fails gracefully without killing the renderer, and reports the tab crash rather than "element no longer exists".MCP configuration
Connecting from WSL2 to a user-launched Chrome on the Windows host started with
--remote-debugging-port=9222(headful, real profile).Chrome DevTools MCP version
1.5.0
Chrome version
Chrome/150.0.7871.47 (Windows x64, headful)
Coding agent version
Claude Code 2.1.201
Model version
claude-fable-5
Node version
v22.22.0
Operating system
Windows Subsystem for Linux (WSL)