- Home
- Skills
- Testing & Debugging
- bypass-macos-file-dialog
Bypass Macos File Dialog
Bypass OS-native file upload dialogs in browser automation using JavaScript interception and DataTransfer injection.
$5
Works with the AI Agents you already use
bypass-macos-file-dialog
Example session with this skill installed
Automate the upload of my generated report.csv file. The browser's native file picker is blocking my automation script, so use the DataTransfer injection method to bypass the dialog.
- Read your context and instructions
- Compiled the bypass-macos-file-dialog
- Generated the data export
Interceptor active. Staging 'report.csv' (2,450 chars).
Synthetic File object created via DataTransfer.
Assigned to <input type="file"> via Object.defineProperty.
Dispatching 'change' event {bubbles: true}.
Upload successful: React component updated state without OS dialog.
report.csv
CSV · data export
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
What it does
This skill provides a battle-tested programmatic workaround for one of the most persistent hurdles in browser automation: the OS-native file upload dialog. Whether you are using Playwright, Puppeteer, Selenium, or Claude's computer-use, clicking a file upload button typically triggers a macOS, Windows, or Linux file picker that freezes automation and requires manual intervention.
This developer-centric tool uses a JavaScript interception technique to bypass the native UI entirely. It overrides the HTMLInputElement.prototype.click method to inject file data directly into the browser's DOM using the DataTransfer API, triggering a synthetic change event that web frameworks recognize as a valid user upload.
Why use this skill
- Zero Manual Intervention: Fully automates file uploads without getting stuck on system-level popups.
- Framework Agnostic: Works seamlessly with React, Angular, Vue, Polymer (YouTube Studio), and jQuery.
- Cross-Platform: Bypasses dialogs on macOS Finder, Windows Explorer, and Linux file managers.
- Invisible to Apps: Sophisticated injection makes the programmatic upload indistinguishable from a real user action.
- Reliable Content Staging: Includes specific patterns for handling large text files, binary data via Base64, and multi-file uploads.
Supported Workflows
The skill is designed for developers building automated scrapers, content uploaders, or RPA bots. It is particularly effective for complex sites like YouTube Studio or enterprise internal tools where input.value assignment is blocked by security headers.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills to Reverse Engineer and Scrape Websites.
Text-Based Files Only: Out of the box, the Python preparation script (prepare_injection.py) reads files using UTF-8 encoding. This means it works perfectly for text-based files (CSV, JSON, TXT, XML, scripts, sbv etc.), but will throw an encoding error if you try to process binary files like .mp4 videos, .pdf documents, or images (.jpg, .png).
File Size Constraints: Because this technique works by injecting the entire file's content into the browser's memory as a JavaScript string, it is not suitable for massive files (e.g., gigabyte-sized video files). Attempting to inject extremely large files may cause the browser tab to run out of memory or crash the automation framework's DevTools protocol.
Single-Shot Execution: The JavaScript interceptor is designed to consume the payload upon use (window.__pendingFile = null; after the click). If your automation needs to upload multiple files in a row, you must re-inject the new file payload before each click.
Strict Execution Order: The JavaScript interceptor (interceptor.js) must be executed in the browser's DOM before the automation tool clicks the upload trigger. If the click happens first, the OS dialog will still open and block the thread.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 months ago
Permissions
Note: This skill requires broad Read access (**/*) because it is designed to prepare and inject any file type (text based) from any location the user specifies into the browser DOM. The script only reads target files and does not modify, delete, or overwrite any local files.