fix(relay): file upload now works over the extension relay (#13)
chrome.debugger forbids DOM.setFileInputFiles, so 'upload' used to hard-fail on the relay and push users to a --launch/direct-CDP session. Now it falls back to reconstructing the File entirely in the page (Playwright/Cypress-style: build a File from the bytes, assign input.files = dataTransfer.files, fire input/change; for drop/paste composers like X, dispatch synthetic paste+drop with the DataTransfer). The bytes are streamed in <1 MiB base64 chunks because the relay tunnels CDP through native messaging (1 MiB/message cap) — a whole image as one arg closed the channel. Verified live over the relay: an 809 KB PNG lands intact on a file input with change firing. No more direct-CDP needed for uploads.
This commit is contained in:
@@ -281,11 +281,11 @@ chrome-use pick @e4 --option "Europe" # ANY combobox (react-select / ARIA /
|
||||
# (no silent no-op). Use this for custom
|
||||
# dropdowns where `select` returns ✓ but
|
||||
# changes nothing.
|
||||
chrome-use upload @e5 file1.pdf # upload file(s) — NOTE: needs a --launch/direct-CDP
|
||||
# session. Over the extension relay it CANNOT work
|
||||
# (Chrome's chrome.debugger forbids it); chrome-use
|
||||
# errors with a hint. Carry your login into a launched
|
||||
# session via `cookies export` | `cookies set --curl`.
|
||||
chrome-use upload @e5 file1.pdf # upload file(s) — works over the extension relay too:
|
||||
# chrome.debugger forbids setFileInputFiles, so the
|
||||
# file's bytes are streamed into the page and rebuilt as
|
||||
# a File there (chunked under native-messaging's 1 MiB cap).
|
||||
# Works on file <input>s and drop/paste composers (e.g. X).
|
||||
chrome-use scroll down 500 # scroll page (up/down/left/right)
|
||||
chrome-use scrollintoview @e1 # scroll element into view
|
||||
chrome-use drag @e1 @e2 # drag and drop
|
||||
|
||||
Reference in New Issue
Block a user