您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a red Close button in the left top corner to any overlays on Tinychat (profile and fatal error popups)
// ==UserScript== // @name Jojo's Fatal Error Remover // @namespace http://tampermonkey.net/ // @license “Commons Clause” License Condition v1.0 // @version 1.1 // @description Adds a red Close button in the left top corner to any overlays on Tinychat (profile and fatal error popups) // @author Jojoooooo // @match https://tinychat.com/room/* // @icon https://www.google.com/s2/favicons?sz=64&domain=tinychat.com // @grant none // @run-at document-start // ==/UserScript== (function() { 'use strict'; let loadingInterval = setInterval(() => { if(document.querySelector("tinychat-webrtc-app") === null || document.querySelector("tinychat-webrtc-app") === undefined) { return; } initialize(); clearInterval(loadingInterval); }, 200); })(); function initialize() { var mutationObserver = new MutationObserver(m => { if(m.length < 0) return; let modal = m[0]; if(modal.type !== "attributes") return; if(modal.target.className == "modal-show"){ console.log("Showing modal"); let button = document.createElement("button"); button.onclick = () => { modal.target.querySelector("#force-close-modal").remove(); document.querySelector("tinychat-webrtc-app").shadowRoot.querySelector("#modal").dialogs = {} document?.querySelector("tinychat-webrtc-app")?.shadowRoot?.querySelector("#modal")?.shadowRoot?.querySelector("#modal-window")?.removeAttribute("class") document?.querySelector("tinychat-webrtc-app")?.shadowRoot?.querySelector("#modal")?.querySelector("#fatal")?.remove() }; button.style.width="100px"; button.style.height="100px;" button.style.position="absolute"; button.style.left="10px"; button.style.top="10px"; button.style.borderRadius="12px"; button.style.backgroundColor="red"; button.style.zIndex="100000"; button.style.cursor="pointer"; button.style.color="black"; button.style.fontWeight="700"; button.style.fontSize="16px"; button.textContent="CLOSE"; button.id="force-close-modal"; modal.target.append(button); } else { console.log("Hiding modal"); modal.target.querySelector("#force-close-modal").remove(); } }); mutationObserver.observe(document.querySelector("tinychat-webrtc-app").shadowRoot.querySelector("#modal").shadowRoot .querySelector("#modal-window"), {childList:true, subtree: true, attributes: true}); }