您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Press "." to Toggle the Store menu and Press "," to Toggle the Alliance menu
// ==UserScript== // @name MooMoo.io - 1.8.0 Toggle Menus // @author Seryo // @description Press "." to Toggle the Store menu and Press "," to Toggle the Alliance menu // @version 0.1 // @match *://*.moomoo.io/* // @namespace https://greasyforks.org/users/1190411 // @icon https://cdn.glitch.com/82ae8945-dcc6-4276-98a9-665381b4cd2b/cursor12.png // @run-at document-end // @license MIT // @grant GM_info // ==/UserScript== (function () { 'use strict'; let allianceMenu = document.getElementById('allianceMenu'); let storeMenu = document.getElementById('storeMenu'); document.addEventListener('keydown', function (event) { if (shouldHandleMenus(event)) { if (event.key === ',') { toggleMenu(allianceMenu, storeMenu); } else if (event.key === '.') { toggleMenu(storeMenu, allianceMenu); } } }); function shouldHandleMenus(event) { const chatboxActive = document.activeElement.id.toLowerCase() === 'chatbox'; const allianceInputActive = document.activeElement.id.toLowerCase() === 'allianceinput'; return !chatboxActive && !allianceInputActive; } function toggleMenu(menu, otherMenu) { if (menu.style.display === 'none' || menu.style.display === '') { menu.style.display = 'block'; if (otherMenu.style.display !== 'none') { otherMenu.style.display = 'none'; } } else { menu.style.display = 'none'; } } })();