您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to clear chat
// ==UserScript== // @name Bonk Clear Chat // @version 1.1 // @author Salama // @description Adds a button to clear chat // @match https://*.bonk.io/gameframe-release.html // @run-at document-start // @grant none // @supportURL https://discord.gg/Dj6usq7ww3 // @namespace https://greasyfork.org/users/824888 // @license MIT // ==/UserScript== (function() { 'use strict'; let button = document.createElement('div'); document.getElementById("newbonklobby_chatbox").getElementsByClassName("newbonklobby_boxtop newbonklobby_boxtop_classic")[0].appendChild(button); button.outerHTML = `<div id="clearchatbutton" class="brownButton brownButton_classic buttonShadow" style="line-height: 24px;visibility: inherit;margin: 0;top: 4;left: 4;font-family: 'futurept_b1';font-size: 16px;width: 100px;height: 24px;position: absolute;">CLEAR</div>`; document.getElementById("clearchatbutton").addEventListener('click', () => { for(let msg of [...document.getElementById("newbonklobby_chat_content").children].concat([...document.getElementById("ingamechatcontent").children])) { msg.remove(); } }); console.log("Clear chat button added"); })();