Tech News
← Back to articles

Show HN: To-Userscript: Chrome Extension to Userscript Converter

read original related products more articles

Demo 2x Speed (conversion takes 4s total normal speed, incl. downloading) to-userscript.mp4 Demo but normal speed Screen.Shot.2025-06-20.at.7.59.06.AM.mov

A powerful CLI for converting browser extensions into standalone userscripts.

What is this?

to-userscript bridges the gap between complex, packaged browser extensions and simple, portable userscripts. It takes an extension from the Chrome or Firefox store, a local directory, or a zip/xpi, and creates a single .user.js file that can be run in any userscript manager. This allows you to use, or modify extensions on browsers or platforms that might not natively support them.

Key Features

Multi-Source Conversion: Convert from Chrome Web Store, Firefox Add-ons site, direct URLs, local directories, or archive files ( .crx , .xpi , .zip ).

Convert from Chrome Web Store, Firefox Add-ons site, direct URLs, local directories, or archive files ( , , ). Comprehensive API Polyfills: Intelligently replaces common WebExtension APIs ( chrome.storage , chrome.runtime , chrome.tabs , etc.) with userscript-compatible equivalents ( GM_* functions, IndexedDB, and custom event buses).

Intelligently replaces common WebExtension APIs ( , , , etc.) with userscript-compatible equivalents ( functions, IndexedDB, and custom event buses). Automatic Asset Inlining: Seamlessly embeds CSS, images, fonts, and other resources directly into the script using data URIs or Blob URLs, ensuring complete portability (replacing runtime.getURL and options/popup pages).

Seamlessly embeds CSS, images, fonts, and other resources directly into the script using data URIs or Blob URLs, ensuring complete portability (replacing runtime.getURL and options/popup pages). UI Emulation: Renders extension popup and options pages within an embedded modal (after inlining all asset links), preserving most UI functionality.

Renders extension popup and options pages within an embedded modal (after inlining all asset links), preserving most UI functionality. Background Script Support: Emulates the background script environment, allowing persistent logic to run as intended and two way messaging.

... continue reading