Amazonの商品画像を追加 [仮]

マケプレのものはサムネが出ないっぽい…?

目前为 2021-11-26 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Amazonの商品画像を追加 [仮]
  3. // @description マケプレのものはサムネが出ないっぽい…?
  4. // @version 1.1
  5. // @match https://img.2chan.net/b/res/*.htm
  6. // @icon https://www.google.com/s2/favicons?domain=2chan.net
  7. // @grant none
  8. // @namespace https://gf.qytechs.cn/users/809755
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. /* jshint esversion: 6 */
  13.  
  14. (function() {
  15. 'use strict';
  16. function a() {
  17. document.querySelectorAll("blockquote a[href*=amazon]").forEach(a => {
  18. const m = a.href.match(/amazon[^/]+jp\/(?:dp|gp\/product)\/(\w+)/);
  19. if (m && !a.getAttribute("imgAdded")) {
  20. const img = document.createElement('img');
  21. img.src = `//images-na.ssl-images-amazon.com/images/P/${m[1]}.09.MZZZZZZZ.jpg`;
  22. a.setAttribute("imgAdded", "1");
  23. a.href = a.innerText = `https://www.amazon.co.jp/dp/${m[1]}`;
  24. a.parentNode.insertBefore(img, a);
  25. a.parentNode.insertBefore(document.createElement('br'), a);
  26. }
  27. })
  28. }
  29. setInterval(a, 2 * 1000);
  30. })();

QingJ © 2025

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