Tampermonkey® by Jan Biniok

@include

The pages on that a script should run. Multiple tag instances are allowed. @include doesn't support the URL hash parameter. You have to match the path without the hash parameter and make use of window.onurlchange

// @include http://www.tampermonkey.net/*
// @include http://*
// @include https://*
// @include /^https:\/\/www\.tampermonkey\.net\/.*$/
// @include *

Note: When writing something like *://tmnk.net/* many script developers expect the script to run at tmnk.net only, but this is not the case. It also runs at https://example.com/?http://tmnk.net/ as well.

Therefore Tampermonkey interprets @includes that contain a :// a little bit like @match. Every * before :// only matches everything except : characters to makes sure only the URL scheme is matched. Also, if such an @include contains a / after ://, then everything between those strings is treat as host, matching everything except / characters. The same applies to * directly following ://.

@match

In Tampermonkey, the @match directive is used to specify the web pages that your script should run on. The value of @match should be a URL pattern that matches the pages you want your script to run on. Here are the parts of the URL pattern that you'll need to set:

// @match <protocol>://<domain><path>
  • protocol - This is the first part of the URL, before the colon. It specifies the protocol that the page uses, such as http or https. * matches both.
  • domain - This is the second part of the URL, after the protocol and two slashes. It specifies the domain name of the website, such as tmnk.com. You can use the wildcard character this way *.tmnk.net to match tmnk.net and any sub-domain of it like www.tmnk.net.
  • path - This is the part of the URL that comes after the domain name, and may include additional subdirectories or filenames. You can use the wildcard character * to match any part of the path.

Please check this documentation to get more information about match pattern. Note: the <all_urls> statement is not yet supported and the scheme part also accepts http*://.

Multiple tag instances are allowed.

More examples:

// @match *://*/*
// @match https://*/*
// @match http://*/foo*
// @match https://*.tampermonkey.net/foo*bar

@exclude

Exclude URLs even it they are included by @include or @match.

Multiple tag instances are allowed.