bypass-macos-file-dialog
Bypass OS-native file upload dialogs in browser automation using JavaScript interception and DataTransfer injection.
- Automate YouTube subtitle uploads without manual Finder interaction
- Inject files into Puppeteer/Playwright scripts when .setInputFiles() fails
- Programmatically upload large CSV/JSON datasets to web dashboards
$5
One-time purchase · Own forever
What you get
- Downloadable skill package
- Works with Windows, including Google Chrome
- 2 permissions declared
See it in action
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.bypass-macos-file-dialog
Bypass OS-native file upload dialogs in browser automation using JavaScript interception and DataTransfer injection.
$5
One-time purchase · Own forever
What you get
- Downloadable skill package
- Works with Windows, including Google Chrome
- 2 permissions declared
- Instant install
- One-time purchase
See it in action
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.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.
Use Cases
- Automate YouTube subtitle uploads without manual Finder interaction
- Inject files into Puppeteer/Playwright scripts when .setInputFiles() fails
- Programmatically upload large CSV/JSON datasets to web dashboards
- Bypass security-restricted file inputs in React and Angular applications
- Upload files (text base not PDF or MP4 etc) to websites without getting blocked when MacOS file upload window appears.
Known Limitations
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 Install
unzip bypass-macos-file-dialog.zip -d ~/.claude/skills/Reviews
No reviews yet — be the first to share your experience.
Only users who have downloaded or purchased this skill can leave a review.
Early access skill
Be the first to review this skill.
Only users who have downloaded or purchased this skill can leave a review.
Security Scanned
Passed automated security review
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.
Tags
Supported Operating Systems: Fully compatible with macOS, Windows, and Linux environments. Supported Web Browsers: Works seamlessly across all major modern browsers, including Google Chrome, Mozilla Firefox, Microsoft Edge, and Apple Safari. Automation Frameworks: Designed to work with standard browser automation and RPA tools, including Puppeteer, Playwright, Selenium, and Claude computer-use. Technical Requirements: Python Payload Preparer (prepare_injection.py): Requires Python 3 to run. It utilizes only built-in standard libraries (such as json, os, and argparse), meaning no external dependencies or pip install commands are required. JavaScript Interceptor (interceptor.js): Written in pure Vanilla JavaScript using standard web APIs (DataTransfer, File, Object.defineProperty). It is entirely framework-agnostic and has been battle-tested on complex single-page applications, including YouTube Studio's Polymer-based interface. Important Implementation Note: For the bypass to function correctly, the JavaScript interceptor script must be injected and executed within the browser's DOM before your automation tool triggers the click event on the target file upload button.
Creator
Claude Skills
Freelancer, internet entrepreneur and music producer from Sweden.
Frequently Asked Questions
Learn More About AI Agent Skills
Similar Skills
video enhancement
Upscale, denoise, and sharpen videos using AI with support for local files, YouTube, and batch processing.
code-reviewer
Reviews your code for bugs, security vulnerabilities, logic errors, performance issues, and style violations. Organizes findings by severity and suggests fixes with code examples.
git-commit-writer
Writes conventional commit messages by analyzing your staged git changes. Detects commit type, scope, and breaking changes automatically.
readme-generator
Generates a complete, polished README.md by scanning your actual project structure, dependencies, and code.