マケプレのものはサムネが出ないっぽい…?
当前为
// ==UserScript==
// @name Amazonの商品画像を追加 [仮]
// @description マケプレのものはサムネが出ないっぽい…?
// @version 1.1.1
// @match https://img.2chan.net/b/res/*.htm
// @icon https://www.google.com/s2/favicons?domain=2chan.net
// @grant none
// @namespace https://greasyfork.org/users/809755
// @license MIT
// ==/UserScript==
/* jshint esversion: 6 */
(function() {
'use strict';
function a() {
document.querySelectorAll("blockquote a[href*=amazon]").forEach(a => {
const m = a.href.match(/amazon[^/]+jp\/.*(?:dp|gp\/product)\/(\w+)/);
if (m && !a.getAttribute("imgAdded")) {
const img = document.createElement('img');
img.src = `//images-na.ssl-images-amazon.com/images/P/${m[1]}.09.MZZZZZZZ.jpg`;
a.setAttribute("imgAdded", "1");
a.href = a.innerText = `https://www.amazon.co.jp/dp/${m[1]}`;
a.parentNode.insertBefore(img, a);
a.parentNode.insertBefore(document.createElement('br'), a);
}
})
}
setInterval(a, 2 * 1000);
})();