Skip to content

Instantly share code, notes, and snippets.

@ssig33
Last active November 14, 2019 09:40
Show Gist options
  • Save ssig33/7ff113061e9d99e4e584876c6bda776c to your computer and use it in GitHub Desktop.
Save ssig33/7ff113061e9d99e4e584876c6bda776c to your computer and use it in GitHub Desktop.
// ==UserScript==
// @id Amazon URL Cleaner
// @name Amazon URL Cleaner
// @namespace http://efcl.info/
// @description replaceState for Amazon
// @include https://www.amazon.co.jp/*
// @include https://www.amazon.com/*
// @version 0.0.1.20140518104255
// ==/UserScript==
(function(doc) {
// ASIN.0 in kindle store
var asin = doc.getElementById("ASIN") || doc.getElementsByName("ASIN.0")[0];
if (asin) {
asin = asin.value
history.replaceState(null, "Amazon URL Cleaner", "/dp/" + asin + "/");
}
})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment