Amazon short URL

Replace article URL with short Amazon permalink

目前為 2017-09-15 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Amazon short URL
  3. // @namespace graphen
  4. // @description Replace article URL with short Amazon permalink
  5. // @include /^https?://www\.amazon\.(cn|in|co\.jp|sg|fr|de|it|nl|es|co\.uk|ca|com(.\(mx|au|br))?/.*(dp|gp/product|exec/obidos/ASIN|o/ASIN)/.*$/
  6. // @noframes
  7. // @grant none
  8. // @version 1
  9. // ==/UserScript==
  10. (function(doc) {
  11. // ASIN.0 in kindle store
  12. var asin = doc.getElementById("ASIN") || doc.getElementsByName("ASIN.0")[0];
  13. if (asin) {
  14. asin = asin.value;
  15. history.replaceState(null, "Amazon URL Cleaner", "/dp/" + asin + "/");
  16. }
  17. })(document);