3 ms·
> There's no (easy) way to send US traffic to the Amazon.com site You can run a small snippet of JS that replaces all the links with amazon.co.uk to amazon.com
by slig 12y ago
> There's no (easy) way to send US traffic to the Amazon.com site
You can run a small snippet of JS that replaces all the links with amazon.co.uk to amazon.com. You have to figure out that the user is from the US (maybe reading the Accept-Language, don't know if that's reliable)
// untested
var links = document.getElementsByTagName('a');
for (i=0; i<links.length; i++){
var link = links[i];
if (link.href.match(/amazon.co.uk/))
link.href = link.href.replace('.co.uk', '.com')
}
- unwiredben 12y agonavigator.language will return a string like "en-US", "en-GB", or "fr-FR" depending on the user's selected locale. That could be used to map different Amazon URLs, although it looks like you may get a fair number of en-US false reports. See https://html.spec.whatwg.org/multipage/webappapis.html#navigatorlanguage https://html.spec.whatwg.org/multipage/webappapis.html#navig....