upload_file
Attach a local file to a browser page's file input element using Chrome DevTools Protocol, circumventing the sandbox environment's file picker that causes renderer hangs.
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). 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.
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 |