Skip to content

Feature request: native browser_file_upload tool (setInputFiles equivalent) #5

@Cocoloco069

Description

@Cocoloco069

Context

Glance is excellent for vision-first browser testing. However, it lacks a native tool for uploading files via <input type="file"> elements. This blocks any test scenario involving file uploads — a very common use case.

Current workaround

We worked around this using browser_evaluate with a two-step approach:

  1. DataTransfer + Object.defineProperty: Build a File from base64, attach to the input via Object.defineProperty, fire change event.
  2. React-Fiber injection: Find __reactProps$... key on the input element, call memoizedProps.onChange with a synthetic event.

This works for React-based apps but is fragile (depends on React internals) and doesn't generalize to other frameworks.

Proposed feature

Add mcp__glance__browser_file_upload tool, modeled after Microsoft Playwright MCP's browser_file_upload, which uses Playwright's native setInputFiles. This is:

  • Framework-agnostic (works with React, Vue, vanilla JS, Web Components)
  • Robust (uses CDP DOM.setFileInputFiles under the hood)
  • Well-tested (industry standard via Playwright)

API suggestion

mcp__glance__browser_file_upload({
  selector: string,           // CSS selector or accessibility ref
  filePaths: string[],        // absolute paths on test machine
})

Use case

We're building a humanlike E2E test suite for pdfredo.com (PDF tool platform with 36 tools). Every tool needs file upload as the entry point. Currently we maintain a 100+ line workaround helper. A native tool would simplify our test scenarios significantly.

Reference: Microsoft Playwright MCP file upload — https://github.com/microsoft/playwright-mcp

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