Objective
Teach users the theory of how to "run" .exe files with browser extensions.
Introduction
Browser extensions allow developers to extend the browser's capabilities. For example, they provide more control over downloads. By default, the browser only saves files to the folder set in its configuration or to a location chosen by the user via the file explorer. With background context in an extension, you can create subfolders, overwrite files, delete files, and more.
But what if you need even more control? Something that requires the user’s machine for advanced processing—operations that the browser itself cannot perform, like adding or updating metadata in downloaded files.
Accessing such low-level operations is blocked by browsers for security reasons. Does that mean you must always create a desktop or mobile app? Usually, yes, and that may be the best practice. But if you want to avoid that, there is one possible option: Native Messaging.
Content
- Browsers block direct communication with the OS and the device to prevent JavaScript-based malware.
- Because of this, tasks like editing metadata on downloaded media cannot be performed directly in the browser.
- However, browsers can allow you to trigger processes that already exist on the user’s machine (like
.exefiles) securely and in the background. This is done using Native Messaging.
Native Messaging
Native Messaging is an official Chrome mechanism that allows a browser extension to securely communicate with a native application (e.g., an .exe file on Windows). It acts as a bridge between the browser and the operating system, enabling the extension to “talk” to local programs without violating Chrome’s security rules.
Important points:
- You cannot run native applications that block the flow indefinitely, such as processes that require the user to manually select files.
- Processes must be straightforward and predictable, like merging files or converting videos automatically.
Scenario
Imagine "Paco" wants to download videos from Fansly. The API delivers 2-second chunks instead of complete videos. Concatenating these chunks creates a playable video, but for an end user, this is not usable without additional processing.
Solution
After considering options, a developer might decide on this approach:
- Create a browser extension that renders buttons to download all media displayed in the Fansly app.
- Use software like
ffmpegto process media delivered in chunks (e.g.,.m3u8or MDN resources). Paco doesn’t need to know the details—as long as he can play the final video, it works. - Use offline tools to reduce costs and dependencies. While WebAssembly versions of
ffmpegexist (ffmpeg.wasm), browsers have memory limits, and large or parallel downloads (e.g., 4K, 30-minute videos) could crash the window. Using a.exefile that runs locally is safer and more efficient than creating a server to handle the processing.
Workflow summary:
- The extension downloads all chunks in the default Downloads folder.
- A signal is sent via Native Messaging to trigger the executable on the user’s machine.
- The
.exemerges and converts the chunks into a final MP4 file, completing the task seamlessly.
Conclusion
Chrome does not allow direct execution of .exe files, but it offers an official and secure mechanism (Native Messaging) to integrate with native applications when justified. The only caveat is that the user must install the executable or save the files somewhere on their device.
An extension using this workflow is already online, proving that desktop or mobile apps can sometimes be skipped if there’s no strong justification to create them. Many GitHub projects attempt CLI solutions instead, but using the logged-in browser session avoids login configuration.
Fansly Downloader
Download videos and pictures from the content creators you are subscribed to on Fansly.
Did you know you could run executable files using browser extensions? How does this change your perspective on web development? 😱

Top comments (0)