Amazon Multi-Country Check

Check amazon products in multiple other countries.

当前为 2018-09-03 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Amazon Multi-Country Check
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Check amazon products in multiple other countries.
  6. // @author daaawx
  7. // @match http://*/*
  8. // @grant none
  9. // @include http://www.amazon.*
  10. // @include https://www.amazon.*
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. var o;
  17. var rgx = /(\.es|\.co\.uk|\.com\.br|\.com|\.fr|\.ca|\.de|\.it|\.nl|\.au|\.jp|.cn|\.in|\.mx)/;
  18. let links = '<p>';
  19. var currURL = window.location.href;
  20. var title = document.getElementById('productTitle');
  21.  
  22. if (/(\/dp\/|\/gp\/)/.test(currURL)) {
  23. o = currURL.replace(rgx, '.com');
  24. links += `<a href="${o}"><img src="https://i.imgur.com/Hdk4GAa.png" style='margin-right:5px'></a>`;
  25. o = currURL.replace(rgx, '.co.uk');
  26. links += `<a href="${o}"><img src="https://i.imgur.com/i9ALzZg.png" style='margin-right:5px'></a>`;
  27. o = currURL.replace(rgx, '.ca');
  28. links += `<a href="${o}"><img src="https://i.imgur.com/hOItgP9.png" style='margin-right:5px'></a>`;
  29. o = currURL.replace(rgx, '.es');
  30. links += `<a href="${o}"><img src="https://i.imgur.com/LYFA7ic.png" style='margin-right:5px'></a>`;
  31. o = currURL.replace(rgx, '.de');
  32. links += `<a href="${o}"><img src="https://i.imgur.com/VxS75Bk.png" style='margin-right:5px'></a>`;
  33. o = currURL.replace(rgx, '.com.br');
  34. links += `<a href="${o}"><img src="https://i.imgur.com/yXyZaPi.png" style='margin-right:5px'></a>`;
  35. o = currURL.replace(rgx, '.fr');
  36. links += `<a href="${o}"><img src="https://i.imgur.com/M3gZMSs.png" style='margin-right:5px'></a>`;
  37. o = currURL.replace(rgx, '.it');
  38. links += `<a href="${o}"><img src="https://i.imgur.com/oPX8yaF.png" style='margin-right:5px'></a>`;
  39. o = currURL.replace(rgx, '.nl');
  40. links += `<a href="${o}"><img src="https://i.imgur.com/aV4eQPw.png" style='margin-right:5px'></a>`;
  41. o = currURL.replace(rgx, '.au');
  42. links += `<a href="${o}"><img src="https://i.imgur.com/iyebylP.png" style='margin-right:5px'></a>`;
  43. o = currURL.replace(rgx, '.jp');
  44. links += `<a href="${o}"><img src="https://i.imgur.com/Ipbx2YQ.png" style='margin-right:5px'></a>`;
  45. o = currURL.replace(rgx, '.cn');
  46. links += `<a href="${o}"><img src="https://i.imgur.com/fXEizr9.png" style='margin-right:5px'></a>`;
  47. o = currURL.replace(rgx, '.in');
  48. links += `<a href="${o}"><img src="https://i.imgur.com/7e8QcJ9.png" style='margin-right:5px'></a>`;
  49. o = currURL.replace(rgx, '.mx');
  50. links += `<a href="${o}"><img src="https://i.imgur.com/cimpnfh.png" style='margin-right:5px'></a>`;
  51. links += '</p>';
  52. title.innerHTML += links;
  53. }
  54.  
  55. })();