What is a userscript? A plain-English guide
A userscript is a small piece of JavaScript that changes a website after it loads. What one looks like, what runs it, what it can do, and how to get one.
23 October 2026 · 4 min read
A userscript is a small program that changes a website for you, in your own browser. It can hide something you never want to see, add a button the site forgot, or tidy up a page that's hard to read. The site itself doesn't change. Only your copy of it does, each time you open it.
If you've heard people talk about Tampermonkey or Greasy Fork, this is what they mean.
What one looks like
A userscript is a single JavaScript file with a short header at the top. Here's a complete one:
// ==UserScript==
// @name Wider article column
// @match https://example.com/articles/*
// @grant none
// ==/UserScript==
document.querySelector("main")?.style.setProperty("max-width", "none")
The header says what the script is called and where it runs. The line underneath is the script itself: it finds the main part of the page and lets it use the full width.
The three header lines you'll see most:
@nameis the script's name, as it shows in your list of scripts.@matchsays which pages it runs on.https://example.com/articles/*means every page whose address starts withhttps://example.com/articles/.@grantasks for extra abilities, such as storing a setting between visits.nonemeans it only needs the page.
What runs it
Browsers don't run userscripts on their own. You need an extension that does, called a userscript manager. Tampermonkey is the best known, and there are others, which we compare in Tampermonkey alternatives.
The manager keeps your scripts, checks each page you open against every script's
@match line, and runs the ones that fit. Most also let you switch a script off, edit
it, and update it when its author publishes a new version.
In Chrome there's one more step. Since Manifest V3, Chrome only lets an extension run scripts you supply once you've turned on Allow User Scripts for it. If a script does nothing at all, that switch is the first thing to check. We explain it in Userscripts not working in Chrome?
What a userscript can do
Anything the page's own JavaScript could do, on the pages it matches:
- Hide things: a sidebar, a pop-up, a feed, a row of recommendations.
- Add things: a button that exports a table, copies a link, or fills a form.
- Change how things look: wider text, bigger fonts, a dark theme.
- Do repeated clicks for you: expand every section, select every item, move to the next page.
Because a userscript runs again each time the page loads, the change sticks. That's the difference from pasting code into the browser's console, which is gone on the next reload.
What it can't do
A userscript lives inside the page. That sets its limits:
- It only runs while the page is open in your browser, on your computer.
- It sees what the page shows you, and nothing on the site's servers that the page doesn't load.
- It can't change Chrome itself, other extensions, or pages it doesn't match.
- When a site redesigns, a script that relied on the old layout can stop working, and needs updating.
Is it safe?
A userscript can read and change everything on the pages it runs on, including what you
type there. So treat one like any other software: install scripts from sources you
trust, look at the @match line to see where it runs, and be wary of a script that
matches every site when its job is about one.
Scripts you write yourself, or have written for you on the page, have the advantage that you can read exactly what they do.
How to get one
There are three ways:
- Install one someone else wrote. Sites such as Greasy Fork list thousands of published scripts. Install a manager, then the script.
- Write it yourself. If you know some JavaScript, you start with the header above and the page's own structure.
- Have one written from a description. Chat assistants can draft a script, but they can't see the page, so they guess at its structure. We go through why that often fails, and what works better, in How to write a userscript with AI.
ScriptPanda takes the third route from inside the page: you describe the change in its side panel, it reads a trimmed outline of the page, then writes the userscript, installs it and runs it. It's a different tool from a manager like Tampermonkey, and ScriptPanda vs Tampermonkey sets out when to use which.
The short version
A userscript is a small, permanent change to a website that lives in your browser. A manager runs it, Chrome asks you to allow it once, and from then on the site works the way you want each time you open it.
Keep reading
- Auto-refresh vs watching a page for changes in ChromeAuto-refresh only helps if you notice what changed. When reloading is enough, and how to make a page tell you when the part you care about changes.
- Userscripts not working in Chrome? Turn on Allow User ScriptsUserscripts that install fine but do nothing in Chrome usually need one switch: Allow User Scripts, on the extension's details page. Here's where it is.
- How to clean up your LinkedIn, X and Reddit feedsLinkedIn won't turn off its feed, X won't hide trends, Reddit charges to remove ads. What each site lets you change, and how to hide the rest.