upload_file
Upload local files to browser file inputs using Chrome DevTools Protocol, bypassing the invisible native file picker that would hang the renderer.
Instructions
Attach a local file to a page's via Chrome DevTools Protocol — use this for ALL browser uploads (logos, images, docs).
The sandbox's native GTK file picker is invisible to us AND hangs the renderer, so never click
an upload button expecting a dialog — call this instead. Works on Chromium started by
launch_app / start-display.sh (they open a per-instance --remote-debugging-port, 9222+N).
selector targets the file input on the MAIN page (default = first file input). If the site
only inserts the after you click its 'upload' control, click that first (it won't open
a dialog we can see, but it wires up the input), then call this.
Returns {"ok", "action", "instance", "detail"}; fails (isError) with the reason if the file is
missing, no CDP target answers, or the selector matches nothing.
NATIVE (non-browser) apps: use open_file() or drive the app's own Open dialog — it IS visible
here. observe/settle_ms: see click().
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| observe | No | none | |
| filepath | Yes | ||
| instance | No | ||
| selector | No | input[type=file] | |
| settle_ms | No |