Closed Bug 2083461 Opened 1 month ago Closed 1 month ago

[firefox-devtools-mcp] upload_file_by_uid reports success but sets no file (regression in 0.10.5)

Categories

(Developer Infrastructure :: Firefox MCP, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gmipf64, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

Steps to reproduce

  1. Start firefox-devtools-mcp 0.10.5 or 0.10.6 with --headless.
  2. Open a local page with <input type=file id=e> and a change listener on it.
  3. Call take_snapshot, then upload_file_by_uid with the uid of that input and the path of an existing file.
  4. Read document.getElementById('e').files.length with evaluate_script.

Actual results

The tool returns upload e1 without an error, but files.length is 0 and no change event fires.

Expected results

The file is set and a change event fires. With 0.10.4 and the same page and steps, files.length is 1 and the change event fires.

Additional notes:

  • Good: 0.10.4. Bad: 0.10.5 and 0.10.6 (latest).
  • Firefox 157.0 on Linux (Fedora 44), Node 22.22.2, headless, fresh profile.
  • 0.10.4 sets the file with WebDriver classic Element Send Keys. Since bug 2074460 (commit c5b79a9a, first released in 0.10.5) the tool sends key actions to the focused element instead, which does not set files on a file input. WebDriver BiDi has input.setFiles for this.
  • With 0.10.4, several newline-separated paths in filePath on a multiple input end up as one selection with one change event. It would help to keep that working.

Prepared with AI assistance (Claude Opus 5.5) and reviewed before submission.

Thanks for filing, will take a look at this regression (had a similar issue when using it yesterday).

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jdescottes)
Priority: -- → P2

The most straightforward way to fix this is indeed to migrate the upload_file_by_uid tool to use WebDriver BiDi input.setFiles. Let's do that.

Flags: needinfo?(jdescottes)
Assignee: nobody → jdescottes
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: