您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Amazon.co.jpの欲しいものリストにポイントを表示
当前为
// ==UserScript== // @name Show points on Amazon.co.jp wishlist // @namespace https://gf.qytechs.cn/ja/users/165645-agn5e3 // @version 1.2 // @description Amazon.co.jpの欲しいものリストにポイントを表示 // @author agn5e3 // @license Apache-2.0 // @match https://www.amazon.co.jp/*/wishlist/* // ==/UserScript== (function () { 'use strict'; window.addEventListener('load', function () { const domParser = new DOMParser(); var observer = new MutationObserver((records) => { for (const record of records) { for (const node of record.addedNodes) { displayPoint(node); } } }); var displayPoint = ((node) => { if (node.querySelectorAll && node.getElementsByClassName('fetched')[0] === undefined && node.querySelector('div[id^="item_"]') !== null && /Kindle版/.test(node.innerText)) { node.getElementsByTagName('div')[0].classList.add('fetched'); const priceSection = node.getElementsByClassName('price-section')[0]; const asin = JSON.parse(priceSection.attributes["data-item-prime-info"].value).asin; console.log(asin); fetch('/dp/' + asin).then((response) => response.text()).then((text) => { const html = domParser.parseFromString(text, 'text/html'); const printPrice = html.getElementsByClassName('print-list-price')[0]; const kindleSave = html.getElementsByClassName('ebooks-price-savings')[0]; const loyaltyPoint = html.getElementsByClassName('loyalty-points')[0]; if (printPrice !== undefined) priceSection.insertAdjacentHTML('afterbegin', printPrice.innerText.replace(/\s+/g, '') + '<br>'); if (kindleSave !== undefined) priceSection.insertAdjacentHTML('beforeend', '[' + kindleSave.innerText.replace(/\s+/g, '') + ']'); if (loyaltyPoint !== undefined) priceSection.insertAdjacentHTML('beforeend', '<br>' + loyaltyPoint.innerText.replace(/\s+/g, '')); node.getElementsByClassName('a-price-symbol')[0].remove(); node.getElementsByClassName('a-price-whole')[0].insertAdjacentHTML('afterbegin', '¥'); node.getElementsByClassName('a-price')[0].classList.add('a-color-price', 'a-size-large'); }).catch((error) => console.error(error)); } }); for (const node of document.getElementsByClassName('g-item-sortable')) { displayPoint(node); } observer.observe(document.getElementById('g-items'), { childList: true, subtree: true, }); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址