Reputation: 67892
Is there a way to prevent chrome from running greasemonkey scripts except for on certain domains? I could do some hackery 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?
Upvotes: 32
Views: 15905
Reputation: 6485
using @include @exclude tags in metadata?
http://diveintogreasemonkey.org/helloworld/metadata.html
https://wiki.greasespot.net/Metadata_Block
Upvotes: 4
Reputation: 67892
Use @match
, as described here.
Example:
// ==UserScript==
// @match http://*/*
// @match http://*.google.com/*
// @match http://www.google.com/*
// @match https://www.google.com/*
// ==/UserScript==
Upvotes: 46