fix(baoyu-post-to-x): reliable image uploads via DOM.setFileInputFiles#190
fix(baoyu-post-to-x): reliable image uploads via DOM.setFileInputFiles#190LiamVisionary wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…loads The clipboard paste approach (Swift copy + osascript Cmd+V) silently fails in many environments: missing Accessibility permissions, Xcode license not accepted, background/headless contexts, or Chrome not being frontmost. This changes x-browser.ts to use DOM.setFileInputFiles as the primary image upload method (same approach already used by x-video.ts and x-article.ts), with clipboard paste kept as a fallback. Also improves submit reliability: - Wait for post button to be enabled (image may still be processing) - Use real CDP mouse click instead of synthetic JS .click() - Verify post submission by waiting for compose dialog to close Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for the pull request! This repository is read-only and is automatically synced from https://clawhub.ai, so we can’t accept changes here. Please make updates on the website instead. |
|
Hey @liuhedev — this fixes a reliability issue with image uploads in The problem: The clipboard paste approach (Swift copy → osascript Cmd+V) silently fails in many environments (missing Accessibility permissions, Xcode license issues, background contexts). Posts go through as text-only even though images were generated. The fix: Uses Tested end-to-end on macOS, working reliably now. Would appreciate a quick review/merge so all users get the fix. Thanks! |
Summary
DOM.setFileInputFilesas the primary method for attaching images to posts (same approach already used byx-video.tsandx-article.ts). Clipboard paste is kept as a fallback..click(), and verifies the post was submitted by checking the compose dialog closes.Problem
The clipboard paste approach (
Swift copy → osascript Cmd+V) silently fails in many environments:This causes posts to appear as text-only even though image generation succeeded — the agent reports success because the paste command returns exit 0, but the image never actually makes it into the compose box.
Test plan
blob:image appears in compose🤖 Generated with Claude Code