Table of Contents Previous entry (meta:resource) Next entry (meta:run_at)
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 ://.
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>
http or https. * matches both.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.* 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 URLs even it they are included by @include or @match.
Multiple tag instances are allowed.