diff --git a/amazon-shorten.user.js b/amazon-shorten.user.js index f9240aa..6351ed0 100644 --- a/amazon-shorten.user.js +++ b/amazon-shorten.user.js @@ -4,6 +4,5 @@ "use strict"; const { pathname } = window.location; -const dp = pathname.match(/(?<=\/(?:dp|gp\/product)\/)\w*/)?.[0]; -const to = dp && `/dp/${dp}`; -if (to && pathname !== to) window.history.replaceState(null, "", to); +const dp = pathname.match(/(?<=\/dp\/|\/gp\/product\/)\w*/)?.[0]; +if (dp) window.history.replaceState(null, "", `/dp/${dp}`);