您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Turns case names seen in the battle UI into clickable links
// ==UserScript== // @name clash.gg case linker (battles) // @version 2.1 // @grant none // @namespace https://clash.gg // @description Turns case names seen in the battle UI into clickable links // @match https://clash.gg/ // @match https://clash.gg/* // @match https://clash.gg/csgo-case-battles // @match https://clash.gg/csgo-case-battles/* // @license MIT // ==/UserScript== /* jshint esversion: 9 */ function getslug(n) { n = n.replaceAll(/(?![*#0-9]+)[\p{Emoji}\p{Emoji_Modifier}\p{Emoji_Component}\p{Emoji_Modifier_Base}\p{Emoji_Presentation}]/gu, ''); //emojis n = n.replaceAll("$", "dollar"); n = n.replaceAll("%", "percent"); n = n.replaceAll("<", "less"); n = n.replaceAll("^", ""); n = n.replaceAll(">", "greater"); //n = n.replaceAll("-", ""); n = n.replaceAll(" ", "-"); n = n.replaceAll("&", "and"); n = n.replaceAll("|", "or"); n = n.replaceAll("=", ""); n = n.replaceAll("{", ""); n = n.replaceAll("}", ""); n = n.replaceAll("[", ""); n = n.replaceAll("]", ""); n = n.replaceAll(";", ""); n = n.replaceAll(",", ""); n = n.replaceAll("/", ""); return n; } function onGet() { var f = document.body.querySelector(".css-fhyd8n"); if (f) { var a = document.createElement("a"); a.setAttribute('href', "https://clash.gg/casescs2/"+getslug(f.innerText)); a.innerText = f.innerText; a.style = "font-weight:bold;color:rgb(64, 94, 245);text-decoration:underline"; f.innerText = ""; f.appendChild(a); } var inte = setInterval(() => { //couldnt find a better way if (!document.body.querySelector(".css-fhyd8n")) { clearInterval(inte); loadfunc(); return; } var o = document.body.querySelector(".css-fhyd8n"); if (o.innerText != "") { var a = document.createElement("a"); a.setAttribute('href', "https://clash.gg/casescs2/"+getslug(o.innerText)); a.innerText = o.innerText; a.style = "font-weight:bold;color:rgb(64, 94, 245);text-decoration:underline"; o.innerText = ""; o.appendChild(a); } }, 300); } const loadfunc = () => { if (document.body.querySelector(".css-fhyd8n")) { onGet(); } const obs = new MutationObserver((mut, f) => { if (document.body.querySelector(".css-fhyd8n")) { obs.disconnect(); onGet(); } }); obs.observe(document.body, {childList: true, subTree: true}); }; window.addEventListener("load", loadfunc);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址