您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Color the thread reply number based on the post count.
当前为
// ==UserScript== // @name [HF] Colored thread reply numbers // @namespace @iNeo19 // @version 0.1 // @description Color the thread reply number based on the post count. // @author You // @match http://hackforums.net/search.php?action=results&sid=* // @grant none // ==/UserScript== function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } (function() { 'use strict'; var threadList = getElementByXpath('//*[@id="content"]/div[2]/table[2]/tbody'); var threads = threadList.getElementsByTagName("tr"); for(var threadIndex=0;threadIndex<threads.length;threadIndex++) { var threadData = threads[threadIndex].getElementsByClassName("forumdisplay_regular"); var postCountRow = threadData[2]; if (postCountRow) { var postCountRaw = postCountRow.getElementsByTagName("a"); var postCountElement = postCountRaw[0]; var postCount = postCountElement.innerHTML; if (postCount <= 0) { postCountElement.style.color = "#33accc"; } else if (postCount <= 10) { postCountElement.style.color = "#329C32"; } else if (postCount > 100) { postCountElement.style.color = "#ff0000"; } else if (postCount > 10) { postCountElement.style.color = "#cc8f33"; } else if (postCount.indexOf(',') >= 0) { postCountElement.style.color = "cyan"; } } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址