您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
2/6/2025, 8:11:41 PM
// ==UserScript== // @name Show "reminds me of" as percentage on fragrantica // @namespace Violentmonkey Scripts // @match https://www.fragrantica.com/perfume/* // @grant none // @license MIT // @version 1.0 // @author owittek // @description 2/6/2025, 8:11:41 PM // ==/UserScript== (function() { 'use strict'; const observer = new MutationObserver((mutations) => { const remindsMeLikes = document.getElementsByClassName('cell small-12 medium-12 large-12'); if (remindsMeLikes.length > 0) { observer.disconnect(); for (const likeBox of remindsMeLikes) { const { children } = likeBox; const [likes, dislikes] = [...children].map((child) => +child.innerText); const clonedNode = children[0].cloneNode(true); likeBox.prepend(clonedNode); const percentageSpan = children[1].querySelector(".num-votes-sp span"); if (percentageSpan) { percentageSpan.style = "font-size: 0.61rem;"; percentageSpan.innerText = `${(likes/(likes + dislikes) * 100).toFixed(2)}`; } } } }); observer.observe(document.body, { childList: true, subtree: true }); })();