Amazon short url

Replaces the current Amazon product URL in the address bar with a shorter version.

  1. // ==UserScript==
  2. // @name Amazon short url
  3. // @namespace https://puac.de/
  4. // @version 0.2.0
  5. // @description Replaces the current Amazon product URL in the address bar with a shorter version.
  6. // @author Hans Puac
  7. // @match https://www.amazon.ae/*
  8. // @match https://www.amazon.ca/*
  9. // @match https://www.amazon.cn/*
  10. // @match https://www.amazon.co.jp/*
  11. // @match https://www.amazon.co.uk/*
  12. // @match https://www.amazon.com.au/*
  13. // @match https://www.amazon.com.be/*
  14. // @match https://www.amazon.com.br/*
  15. // @match https://www.amazon.com.mx/*
  16. // @match https://www.amazon.com.tr/*
  17. // @match https://www.amazon.com/*
  18. // @match https://www.amazon.de/*
  19. // @match https://www.amazon.eg/*
  20. // @match https://www.amazon.es/*
  21. // @match https://www.amazon.fr/*
  22. // @match https://www.amazon.in/*
  23. // @match https://www.amazon.it/*
  24. // @match https://www.amazon.nl/*
  25. // @match https://www.amazon.pl/*
  26. // @match https://www.amazon.sa/*
  27. // @match https://www.amazon.se/*
  28. // @match https://www.amazon.sg/*
  29. // @run-at document-end
  30. // ==/UserScript==
  31.  
  32. (function () {
  33. 'use strict';
  34.  
  35. var asin = document.getElementById('ASIN');
  36.  
  37. if (asin) {
  38. var url = document.location.protocol + '//' + document.location.host + '/dp/' + asin.value;
  39.  
  40. if (url === document.location.href) {
  41. return;
  42. }
  43.  
  44. window.history.replaceState(null, null, url);
  45. }
  46. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址