您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Uses a keyboard shortcut to toggle the left panel in wikis.
// ==UserScript== // @name wiki-toggle-panel // @version 0.3 // @description Uses a keyboard shortcut to toggle the left panel in wikis. // @match https://*.wikipedia.org/* // @match https://wiki.archlinux.org/* // @match https://wiki.postmarketos.org/* // @match https://wiki.alpinelinux.org/* // @match https://wiki.pine64.org/* // @namespace https://greasyforks.org/en/users/217495-eric-toombs // ==/UserScript== function hide() { document.getElementById("mw-panel").hidden = true; document.getElementById("content").style.marginLeft = "0em"; document.panel_hidden = true; } function show() { document.getElementById("content").style.marginLeft = "10em"; document.getElementById("mw-panel").hidden = false; document.panel_hidden = false; } hide(); document.onkeydown = async function(k) { if (k.altKey && k.which === "P".codePointAt(0)) { if (document.panel_hidden) { show(); } else { hide(); } } }