How do I restrict chrome greasemonkey scripts to a single webpage, or just certain webpages?
Is there a way to prevent chrome from running greasemonkey scripts except for on certain domains? I could do some h开发者_高级运维ackery with location.href
, but it would be nice if there were a cleaner solution.
When I install by dragger script.user.js
into the browser, the script automatically runs for all websites.
How do I prevent this?
Use @match
, as described here.
Example:
// ==UserScript==
// @match http://*/*
// @match http://*.google.com/*
// @match http://www.google.com/*
// @match https://www.google.com/*
// ==/UserScript==
using @include @exclude tags in metadata?
http://diveintogreasemonkey.org/helloworld/metadata.html
https://wiki.greasespot.net/Metadata_Block
精彩评论