Skip to content

Instantly share code, notes, and snippets.

@Delivator
Last active August 14, 2019 10:26
Show Gist options
  • Save Delivator/1c124681d85d0e9046214397ee6aaed3 to your computer and use it in GitHub Desktop.
Save Delivator/1c124681d85d0e9046214397ee6aaed3 to your computer and use it in GitHub Desktop.
Amazon Smile redirect
// ==UserScript==
// @name Amazon Smile redirect
// @namespace https://Bgmn.me
// @version 0.4
// @description Redirects www.amazon.de & www.amazon.com url to the respective smile.amazon.tdl domain
// @author Bgmn.me
// @include https://www.amazon.*
// @grant none
// @homepage https://gist.github.com/Delivator/1c124681d85d0e9046214397ee6aaed3
// ==/UserScript==
(function() {
'use strict';
if (window.location.host.startsWith("www.amazon.") && (window.location.pathname.includes("/gp/") || window.location.pathname.includes("/product/") || window.location.pathname.includes("/dp/") || window.location.pathname.includes("/s?"))) {
window.location.href = window.location.href.replace("www.amazon", "smile.amazon");
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment