您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Press the Right Shift to toggle the UI elements on/off.
// ==UserScript== // @name WPlace.live Screenshot mode // @namespace Violentmonkey Scripts // @match *://wplace.live/* // @grant GM_addStyle // @version 2 // @author Ziegel // @license GPL-3.0-or-later; https://spdx.org/licenses/GPL-3.0-or-later.html // @description Press the Right Shift to toggle the UI elements on/off. // @run-at document-end // ==/UserScript== (function() { 'use strict'; // --- Configuration --- const elementSelector = ` div.absolute.z-30, #overlay-pro-panel, div.maplibregl-marker, #bm-A `; const toggleKey = 'ShiftRight'; // --- End of Configuration --- let elementsAreVisible = true; GM_addStyle(` .hidden-by-userscript { display: none !important; } `); function toggleElements() { const elementsToToggle = document.querySelectorAll(elementSelector); if (elementsToToggle.length === 0) { console.warn('[UI Toggler] No elements found with the selector:', elementSelector); return; } elementsToToggle.forEach(element => { element.classList.toggle('hidden-by-userscript'); }); elementsAreVisible = !elementsAreVisible; console.log(`[UI Toggler] Elements are now ${elementsAreVisible ? 'visible' : 'hidden'}.`); } document.addEventListener('keydown', function(event) { if (event.code === toggleKey) { toggleElements(); } }); console.log('[UI Toggler] Script loaded. Press Right Shift to toggle elements.'); })();