Greasy Fork is available in English.
Automatically redirects all www.amazon.com URLs to their smile.amazon.com equivalent.
< Feedback on Amazon Auto-Smile
minor correction: For the fix I mentioned relating to 'amazon.com' urls:
var new_host = window.location.host.replace(/^www\./, 'smile.');
to
var new_host = window.location.host.replace(/^(www\.)?/, 'smile.');
which would make the 'www.' at the beginning of the site's host name be optional.
2019-Oct-21 works fine assuming you're already logged in to smile.amazon
Functionality:
As of 21 Oct, 2019, this appears to be working fine assuming that you are already logged into smile.amazon.com (e.g. either you checked 'remember me' in normal browsing mode or you have it logged in from another tab in private browsing mode).
Tested in Chromium w/ ViolentMonkey running on Linux Mint 19.2; opening www.amazon.com links from google/review sites, it was correctly redirected to smile.amazon.com.
Note: that if a site omits the www and just has the url as just 'https://amazon.com' (rather than 'https://www.amazon.com'), then this script will not work out-of-the-box. You can fix this (after installing) by duplicating the 2 lines with '@match' so that you have 4 @match lines that cover http and https for amazon.com and www.amazon.com.
Security:
I am a professional web developer and have reviewed the script. I do not see anything harmful; it is restricted to only operating only on amazon.com, operates only under safe conditions (e.g. top-level page only, no iframes), and does not contain remote calls.