您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
((made with <3 by lune))
当前为
// ==UserScript== // @name Moonbounce Chat Keybind // @namespace https://github.com/diary001/moonbounce // @supportURL https://discord.gg/mbe // @license MIT // @version 1.0.0 // @description ((made with <3 by lune)) // @author lune / linktr.ee/moon // @match *://*/* // @icon https://framerusercontent.com/images/iuVZmsE2sifPExZXNrETQrDkU.png // @grant none // ==/UserScript== (function() { 'use strict'; const simulateClick = new MouseEvent('click', { bubbles: true, cancelable: true, view: window }); function toggleChatbox() { const chatBoxContainer = document.querySelector("div#moonbounce-ext-container-mbheeaapbjpckahhciogfdodofjjldem"); if (chatBoxContainer) { //console.log("%cChatbox container found.", "background: #44515a; color: #aef0ff; font-size: x-large"); const chatBoxButton = chatBoxContainer.shadowRoot.querySelector("#MOONBOUNCE\\.PORTAL > div:nth-child(2) > div > div > div > div._frame_1htaw_72 > button"); if (chatBoxButton) { //console.log("%cChatbox button found.", "background: #44515a; color: #aef0ff; font-size: x-large"); chatBoxButton.dispatchEvent(simulateClick); } else { //console.log("%cChatbox button not found.", "background: #44515a; color: #aef0ff; font-size: x-large"); } } else { //console.log("%cChatbox container not found.", "background: #44515a; color: #aef0ff; font-size: x-large"); } } function focusInput() { const inputContainer = document.querySelector("div#moonbounce-ext-container-mbheeaapbjpckahhciogfdodofjjldem"); if (inputContainer) { //console.log("%cInput container found.", "background: #44515a; color: #aef0ff; font-size: x-large"); const input = inputContainer.shadowRoot.querySelector("#MOONBOUNCE\\.PORTAL > div:nth-child(2) > div > div > div._base_1jfm3_1._overlay_card_mdpvo_9 > div > div:nth-child(5) > div > form > div > input"); if (input) { //console.log("%cInput found.", "background: #44515a; color: #aef0ff; font-size: x-large"); input.focus(); } else { //console.log("%cInput not found.", "background: #44515a; color: #aef0ff; font-size: x-large"); } } else { //console.log("%cInput container not found.", "background: #44515a; color: #aef0ff; font-size: x-large"); } } document.addEventListener('keydown', function(event) { if (event.key === '/') { //console.log("%c/ has been pressed.", "background: #44515a; color: #aef0ff; font-size: x-large"); toggleChatbox(); setTimeout(function() { focusInput(); //console.log("%cWaited 1ms.", "background: #44515a; color: #aef0ff; font-size: x-large"); }, 1); } }); })();