您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A Mod for room list filters.
// ==UserScript== // @name Hitbox Room List Search // @namespace http://tampermonkey.net/ // @version v1.00 // @description A Mod for room list filters. // @author iNeonz // @match https://heav.io/game.html // @match https://hitbox.io/game.html // @match https://heav.io/game2.html // @match https://hitbox.io/game2.html // @match https://hitbox.io/game-beta.html // @icon https://www.google.com/s2/favicons?sz=64&domain=heav.io // @grant none // @run-at document-idle // ==/UserScript== const roomListTop = document.querySelector("#appContainer > div.roomListContainer > div.flexPaddingCenter > div.roomList"); const div = document.createElement('span'); div.classList.add("title"); div.classList.add("row"); roomListTop.appendChild(div); div.innerHTML = `Includes<input style="background: #303030; border: 1px solid #222222; font-family: 'Bai Jamjuree'; outline: none; color: #ebebeb; padding: 4px;" class="nameField" maxlength="50">`; div.style.right = '20px'; div.style.position = 'absolute'; div.style.top = '15.5px'; let mustInclude = ''; div.children[0].addEventListener('keyup',() => { if (mustInclude != div.children[0].value) { mustInclude = div.children[0].value; document.querySelector("#appContainer > div.roomListContainer > div.flexPaddingCenter > div.bottomButton.middle").click(); } }) new Promise((r) => { let setId = setInterval(() => { let roomList = document.querySelector("#appContainer > div.roomListContainer > div.flexPaddingCenter > div.roomList > div.scrollBox > table > tbody"); if (roomList && roomList.children[0]) { console.log("found list") console.log(roomList); roomList.addEventListener("DOMNodeInserted", function(event){ // newElem is the newly injected element let newElem = event.srcElement; if (newElem && newElem.parentNode.classList && newElem.parentNode.classList.contains("HOVERUNSELECTED")){ setTimeout(() => { if(!newElem.parentNode.children[0].textContent.includes(mustInclude)) { newElem.parentNode.remove(); } },0) } }); r(); clearInterval(setId); } },10); })