Browser StudioBrowser Studio

Free tool

Userscript header generator

Fill in a form and copy a ready ==UserScript== block. Every @match line is checked as you type.

@grant
// ==UserScript==
// @name         My userscript
// @version      1.0.0
// @match        https://example.com/*
// @grant        none
// ==/UserScript==

How it works

From form to header in three steps.

  1. 01

    Describe the script

    Name, namespace, version and a one-line description.

  2. 02

    Choose where it runs

    Your @match lines, anything to exclude, the @grant functions and @run-at.

  3. 03

    Copy the header

    Paste the block at the top of your script in Tampermonkey or Violentmonkey.

FAQ

Userscript headers, explained.

It's the comment block at the top of every userscript, between // ==UserScript== and // ==/UserScript==. Userscript managers such as Tampermonkey, Violentmonkey and Greasemonkey read it to learn the script's name and version, which pages it runs on (@match), which special functions it needs (@grant), and when to run it (@run-at).

In Tampermonkey, @grant none turns the sandbox off: the script runs without any GM_ functions, apart from the GM_info property. Use it for scripts that only change the page. If you need to store values, make cross-site requests or add menu commands, grant those functions by name instead. Leaving @grant out entirely is not the same as none.

When the script has to act before the page draws, for example to hide an element without it flashing on screen or to change something the page's own scripts read early. document-start injects as fast as possible, document-end runs once the page's HTML has loaded (DOMContentLoaded), and document-idle, the default, runs after that.

@namespace together with @name identifies a script, so two scripts with the same name from different authors don't overwrite each other when installed or updated. Use a URL you control, such as your website or GitHub profile. It's never visited.

The header keys are the same, but Greasemonkey 4 replaced the GM_ functions with promise-based ones on a GM object, so you grant and call GM.getValue rather than GM_getValue. Tampermonkey and Violentmonkey support both styles. If a script must run everywhere, the GreaseSpot wiki offers a polyfill.

Rather not write it by hand?

ScriptPanda writes the userscript from a description. Open it on the page, say what you want, and it builds the tool into the page, then fixes it when the site changes.

Try ScriptPanda