Wintus
9/27/2017 - 4:21 PM

Amazon Minimum URL JS

Amazon Minimum URL JS

const domId       = "productDetailsTable";
const asinMatcher = /(?:ASIN:\s*)(\w+)/;

const detail = document.getElementById(domId);
const asin   = detail.innerText.match(asinMatcher)[1];

location.href = location.origin + "/dp/" + asin;

// oneline
(()=>{location.href = location.origin + "/dp/" + document.getElementById("productDetailsTable").innerText.match(/(?:ASIN:\s*)(\w+)/)[1];})();