您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
allows the usernames to be clickable like the playerlist
// ==UserScript== // @name Clickable Usernames in chat // @namespace http://tampermonkey.net/ // @version 0.4 // @description allows the usernames to be clickable like the playerlist // @author Two // @match https://sketchful.io/ // @grant none // ==/UserScript== (function () { 'use strict'; document.head.insertAdjacentHTML("beforeend", `<style> .hoverTextt:hover{ transform: scale(1.03); } </style>`) $('#gameChatList').on('DOMNodeInserted', 'li', function (event) { var x = document.querySelectorAll(".gameAvatarName") var f = document.querySelectorAll(".hoverTextt") if (event.target = 'li' && event.originalEvent.path[0].nodeName.toLowerCase() == 'li' && event.originalEvent.path[0].className != "chatAdmin") { //console.log(event.originalEvent.path[0]) var i; var res; for (i = 0; i < x.length; i++) { if(!event.originalEvent.path[0].firstChild.firstChild.children.length){ if (x[i].innerHTML + ": " == event.originalEvent.path[0].firstChild.firstChild.textContent) { res = x[i]; break; } }else{ if (" "+x[i].innerHTML + ": " == event.originalEvent.path[0].firstChild.firstChild.textContent) { res = x[i]; break; } } } event.originalEvent.path[0].className = "hoverTextt" event.originalEvent.path[0].setAttribute("onclick", res.parentElement.parentElement.getAttribute('onclick')) }else{ if(event.target = 'li' && event.originalEvent.path[0].nodeName.toLowerCase() == 'li'&& event.originalEvent.path[0].firstChild.innerText.endsWith("left!") && event.originalEvent.path[0].className == "chatAdmin" && event.originalEvent.path[0].firstChild.getAttribute("color") == "red"){ //console.log(event.originalEvent.path[0]) //console.log(event.originalEvent.path[0].firstChild.innerText.replace(/\w+[.!?]?$/, '') +" has left!") var e; for (e = 0; e < f.length; e++) { //console.log(f[e].firstChild.firstChild.textContent.slice(0, -2) + " ") //console.log(event.originalEvent.path[0].firstChild.innerText.replace(/\w+[.!?]?$/, '')) if(f[e].firstChild.firstChild.textContent.slice(0, -2) + " " == event.originalEvent.path[0].firstChild.innerText.replace(/\w+[.!?]?$/, '')){ f[e].classList.remove("hoverTextt") f[e].removeAttribute("onclick") } } } } }); })();