您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Display percentage values to the right of bars in PrisonStruggle
// ==UserScript== // @name PrisonStruggle Percentage Display // @namespace http://tampermonkey.net/ // @version 1.2 // @description Display percentage values to the right of bars in PrisonStruggle // @author Nina // @match https://prisonstruggle.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Display percentage numbers for bars document.querySelectorAll('.hasTooltip').forEach(el => { const tooltip = el.getAttribute('data-tippy-content'); const match = tooltip.match(/(\d+)[%]/); if (match) { const percentage = match[1] + '%'; const percentageDisplay = document.createElement('span'); percentageDisplay.style.color = 'black'; percentageDisplay.style.position = 'absolute'; percentageDisplay.style.marginLeft = '5px'; percentageDisplay.textContent = `(${percentage})`; el.parentNode.appendChild(percentageDisplay); } }); })();