What are UserScripts?

UserScripts are JavaScript files browsers run on specific websites via a UserScript manager. A UserScript is one file with a metadata header (@match, @grant, @require, @namespace) and a body of JavaScript. The header tells the manager which sites to inject into; the body runs in those pages with whatever permissions you granted.

The pattern, since 2004

UserScripts have been around since Greasemonkey in 2004. They survive because they solve a specific problem cleanly: changing how a website works for you without forking the site, building an extension, or running a headless browser. Customaise adds an AI editor on top so you describe the change in a sentence instead of writing JavaScript by hand.

The GM_* API

UserScript managers expose a set of bridge functions to scripts: GM_setValue / GM_getValue for persistent storage, GM_xmlhttpRequest for cross-origin fetches (controlled by @connect), GM_download for saving files, GM_notification for OS toasts, GM_setClipboard, GM_openInTab, GM_registerMenuCommand, and 14 more. Customaise supports 23 GM_* APIs.

UserScripts vs browser extensions

A browser extension ships in the Chrome Web Store, requires a manifest review, and updates through the store. A UserScript ships through a manager you already trust, runs in any site you've matched, and updates whenever you choose. Extensions are for distribution; UserScripts are for personalisation. Customaise sits between them: extension-grade reliability, UserScript-grade flexibility, AI-grade authoring.

UserScripts in Customaise

Every UserScript runs through the central text/Unicode normalisation pipeline, then through an AST validator, then through the sanitiser, before being injected. AST-level edits via the symbol indexer mean the AI editor can refactor a UserScript without breaking it.