Browser StudioBrowser Studio

Free tool

Userscript @match pattern tester

Paste your @match lines and the URLs you care about. See exactly which pages each pattern runs on, using the same rules Chrome and Tampermonkey use.

Patternhttps://example.com/https://shop.example.com/cart?id=4https://news.ycombinator.com/item?id=1http://example.com/
https://*.example.com/*MatchesMatchesNo matchNo match
https://news.ycombinator.com/item*No matchNo matchMatchesNo match

How it works

From patterns to answers in three steps.

  1. 01

    Paste patterns

    One per line. The // @match prefix is optional.

  2. 02

    Add URLs

    Real pages you want the script on, and a few you don't.

  3. 03

    Read the grid

    Fix any pattern that matches too much or too little.

FAQ

@match patterns, explained.

@match is the userscript header line that says which pages a script runs on. Each line holds one match pattern in the form scheme://host/path, such as https://*.example.com/*. A script can have several @match lines, and it runs on any page that matches at least one of them.

A * scheme matches http and https only. It doesn't match file, ftp or any other scheme. To run on local files, write a separate file:/// pattern.

Yes. A host written as *.example.com matches example.com itself and every subdomain, such as www.example.com or a.b.example.com. It does not match lookalikes such as notexample.com. The * can only be the whole host, or come first followed by a dot.

A pattern without a port matches every port, so http://localhost/* matches localhost:3000 and localhost:8080. Name a port, as in http://localhost:8080/*, to match only that one. The path part is compared with the page's path and its query string, so /item* matches /item?id=1. The #fragment is ignored.

@include accepts looser globs and even regular expressions, which makes it easy to match more pages than you meant. @match uses the stricter match-pattern rules above, so it is the safer choice, and it is what Chrome itself uses for extensions.

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