您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This script will replace all "battle/1234567" text messages to clickable links.
// ==UserScript== // @name Rustclash.com - Text to Link // @namespace https://tampermonkey.com // @version 0.1.1 // @description This script will replace all "battle/1234567" text messages to clickable links. // @author Kapeika // @match https://rustclash.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=rustclash.com // @grant none // @license WTFPL // ==/UserScript== (function() { 'use strict'; setInterval(function() { var textSpans = document.querySelectorAll('span'); for (var i = 0; i < textSpans.length; i++) { var span = textSpans[i]; var text = span.textContent; if (text.includes("battles")) { var regex = /(battles\/[^\s]+)/gi; var newText = text.replace(regex, '<a href="https:\/\/rustclash\.com\/$&" target="_blank" style="color: #22c55e;">$&</a>'); span.innerHTML = newText; } } }, 500); })();