您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove buttons
当前为
// ==UserScript== // @name Youtube Button Remover // @namespace LeKAKiD // @match https://*/* // @grant GM_getValue // @grant GM_setValue // @grant GM_registerMenuCommand // @version 1.3 // @author LeKAKiD // @description Remove buttons // @license MIT // ==/UserScript== const ytButtons = { next: { label: '1 다음 재생 버튼', style: ` a.ytp-next-button { display: none !important; } `, }, autonav: { label: '2 자동 재생 버튼', style: ` [data-tooltip-target-id="ytp-autonav-toggle-button"] { display: none !important; } `, }, subtitle: { label: '3 사용 불가 자막 버튼', style: ` .ytp-subtitles-button:not([title$="(c)"]):not(:hover) { display: none !important; } `, }, youtube: { label: '4 유튜브에서 보기 버튼', style: ` .ytp-youtube-button { display: none !important; } `, }, miniplayer: { label: '5 미니 플레이어 버튼', style: ` .ytp-miniplayer-button { display: none !important; } `, }, theater: { label: '6 극장 모드 버튼', style: ` .ytp-size-button { display: none !important; } `, }, } const defaultConfig = { next: true, autonav: true, subtitle: false, youtube: false, miniplayer: true, theater: true, } const currentConfig = { ...defaultConfig, ...GM_getValue('config', undefined), } const styleElement = document.createElement('style'); document.head.append(styleElement); function setStyle() { const configEntries = Object.entries(currentConfig); const style = configEntries.reduce((prev, [key, value]) => prev + (!value ? ytButtons[key].style : ''), ''); styleElement.textContent = style; } const urlRegex = /https:\/\/(www\.){0,1}youtube\.com\/($|(|watch|embed).*)/; if(urlRegex.test(location.href)) setStyle(); Object.keys(defaultConfig).forEach(key => { GM_registerMenuCommand(ytButtons[key].label, () => { currentConfig[key] = !currentConfig[key]; GM_setValue('config', currentConfig); if(urlRegex.test(location.href)) setStyle(); }) });