I've a specific Greasemonkey 1.8 /Firefox 20 script (Auto-view spoiler boxes) that works great on most sites, but on amazon.com it destroys the layout.
I've tried to exclude amazon.com in the script settings, but it does not work.
Since amazon.com defaults to https:// I've set the exception like this in
User Script -> Auto-view spoiler boxes -> Options -> User settings:
Include Pages:
*http://*
Excluded Pages:
*https://*
Yet, the script still does work on every website (yes, I've cleared the browser cache).
On the script settings tab, the non-editable Included Pages section contains:
http://forums.kingdomofloathing.com/vb/showthread.php*
What I'm doing wrong? How to exclude amazon.com from a Greasemonkey script?
Reference the include and exclude rules for Greasemonkey.
Don't use *http://*
or *https://*
the leading asterisk will yield unexpected results. Also not all Amazon pages use https.
In the user settings, you can use
http://*
for the Included Pages and these four lines for the Excluded Pages:
http://amazon.com/*
http://*.amazon.com/*
https://amazon.com/*
https://*.amazon.com/*
Erase all those user settings entries (the following won't work if you don't), and then use the Edit this User Script button/menu to change the script's metadata block to:
// ==UserScript==
// @name Auto-view spoiler boxes
// @namespace http://userscripts.org/users/75549
// @description Lets you skip clicking the Show button to view spoilers
// @include http://*
// @exclude /^https?://.*amazon\.com/?/
// ==/UserScript==
this lets you use Greasemonkey's regular expression matching to block all common Amazon (USA) addresses with one line.
Finally, not that it is best to avoid scripts that run on every page (http://*
, etc.). You'll have a faster, smoother experience if you just include the select pages where spoilers are an issue for you.