Discussões » Feedback do Greasy Fork
"Applies to" Amazon - only shows some countries, not all.
It's not going to expand that into every single TLD ever - it's just picking a few common domains to display.
The problem is then that users can't find it when searching for example from ViolentMonkey for scripts for the site if they use an Amazon store that's not in the list. It also doesn't come up in the search for all sites at https://greasyfork.org/en/scripts/by-site?q=amazon
So there is no other workaround than adding all the Amazon domains as individual matches?
I have seen plugins use multiple lines like
// @match https://www.amazon.de/
// @match https://www.amazon.com/
// @match https://www.amazon.ca/
// @match https://www.amazon.fr/
// @match https://www.amazon.nl/
// @match https://www.amazon.it/
// @match https://www.amazon.es/
// @match https://www.amazon.co.uk/
but I am trying to avoid this if possible.
but I am trying to avoid this if possible.
If you don't write them explicitly, how Greasy Fork can know which sites you want to apply?
but I am trying to avoid this if possible.
If you don't write them explicitly, how Greasy Fork can know which sites you want to apply?
The match contains:
https://www.amazon.*
So - anything that has to do with amazon.*
I'd be even willing to search for and paste a list in Greasy Fork if need be to help - just don't want to put it in the script.
And Greasy Fork could validate the provided list against the match to make sure it's valid.
It did find these five "amazon.com amazon.net amazon.org amazon.de amazon.co.uk" by itself. Just stopped there.
The problem is then that users can't find it when searching for example from ViolentMonkey for scripts for the site if they use an Amazon store that's not in the list.
What URL does ViolentMonkey use in this case?
What URL does ViolentMonkey use in this case?
This is where it becomes "funny" now. After using it outside of development, I noticed that I had to refresh the page for ViolentMonkey to recognize the script being available for that page. So going to the page didn't load it, but once I refreshed it did.
So I started digging a bit more today.
I removed the @match with the wildcard and just had the individual store URLs, and that did the same. So the wildcard wasn't confusing it.
Then I tried just
// @match https://www.amazon.*/*
and it worked and loaded.
So this matches on all Amazon stores I tried, but of course runs on the whole site:
// @match https://www.amazon.*/*
This matches on the download pages, but only after a refresh:
// @match https://www.amazon.*/hz/mycd/digital-console/contentlist/*
This also matches on the download pages, but also only after a refresh:
// @match https://www.amazon.ca/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.co.jp/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.co.uk/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.com.au/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.com.br/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.com.mx/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.com/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.de/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.es/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.fr/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.in/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.it/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.nl/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.sa/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.se/hz/mycd/digital-console/contentlist/*
// @match https://www.amazon.sg/hz/mycd/digital-console/contentlist/*
I may have to post with ViolentMonkey why it doesn't match with URL on the first try - with or without the wildcard.
In conclusion: the domain wildcard in the URL works with ViolentMonkey, but it seems to have an issue matching the URL - with or without the wildcard of the domain.
I have just posted my new script https://greasyfork.org/en/scripts/486613-amazon-ebook-download-transfer-via-usb-easy-device-click and the auto-generated "Applies to" shows only "amazon.com amazon.net amazon.org amazon.de amazon.co.uk" whereas it works (or at least should work) on all Amazon stores internationally.
I have "@match https://www.amazon.*/hz/mycd/digital-console/contentlist/*"
How do I get it to recognize that it is for all Amazon stores?
The @math works on the actual sites - just not for "Applies to" recognition on Greasy Fork.
Thanks