Amazon: Redirect from amazon.com to amazon.de via ASIN

Asks if you want to go to the local amazon page using ASIN. Some parts are not availible on anamzon.de.

  1. // ==UserScript==
  2. // @name Amazon: Redirect from amazon.com to amazon.de via ASIN
  3. // @namespace https://gf.qytechs.cn/de/scripts/22007
  4. // @description Asks if you want to go to the local amazon page using ASIN. Some parts are not availible on anamzon.de.
  5.  
  6. // @include *.amazon.com/*
  7. // @run-at document-start
  8.  
  9. // @author lukie80
  10. // @copyright Creative Commons Attribution-ShareAlike 3.0 Unported (CC-BY-SA 3.0)
  11. // @license http://creativecommons.org/licenses/by-sa/3.0/
  12. // @version 1.0
  13. // @lastupdated 2016.08.04
  14. //
  15. // ==/UserScript==
  16. //-------------------------------------------------------------------------------------------------------------------
  17.  
  18. //source: http://stackoverflow.com/a/1768114
  19. var reASIN = RegExp("^(http[s]?://)?([\\w.-]+)(:[0-9]+)?/([\\w-%]+/)?(dp|gp/product|exec/obidos/asin)/(\\w+/)?(\\w{10})(.*)?$");
  20. var matchArray = window.location.href.match(reASIN);
  21. if (matchArray) {
  22. var cbox = confirm("Go to amazon.de? (ASIN: "+matchArray[7]+")");
  23. if (cbox == true) {
  24. window.location.assign("http://www.amazon.de/dp/" + matchArray[7]); //"http://" prefix is important otherwise the URL is interpreted as relative
  25. }
  26. }
  27.  
  28. //-------------------------------------------------------------------------------------------------------------------

QingJ © 2025

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