您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
You can hide share button, Thanks button, Clip button, Download button and live chat on YouTube videos.
当前为
// ==UserScript== // @name YouTube Button Hider // @namespace http://tampermonkey.net/ // @version 1.0 // @match https://www.youtube.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @description You can hide share button, Thanks button, Clip button, Download button and live chat on YouTube videos. // @run-at document-idle // @grant none // ==/UserScript== (function() { 'use strict'; // 각 버튼의 숨기기 여부 (1: 숨기기, 0: 놔두기) const featureToggle = { hideShareButton: 1, // 공유 버튼 숨기기 hideThanksButton: 1, // Thanks 버튼 숨기기 hideClipButton: 1, // 클립 버튼 숨기기 hideDownloadButton: 1, // 다운로드 버튼 숨기기 hideSaveButton: 0, // (재생목록에) 저장 버튼 숨기기 hideChatWindow: 1 // 채팅창 숨기기 }; function hideButtons() { if (featureToggle.hideShareButton) { const shareButton = document.querySelector( 'div#top-level-buttons-computed yt-button-view-model button-view-model button[aria-label="공유"]', 'div#top-level-buttons-computed yt-button-view-model button-view-model button[aria-label="Share"]', 'div#top-level-buttons-computed yt-button-view-model button-view-model button[aria-label="共有"]' ); if (shareButton) { shareButton.style.display = 'none'; // 공유 버튼 숨기기 } } if (featureToggle.hideThanksButton) { const thanksButton = document.querySelector( 'div#flexible-item-buttons yt-button-view-model button-view-model button[aria-label="Thanks"]' ); if (thanksButton) { thanksButton.style.display = 'none'; // 공유 버튼 숨기기 } } if (featureToggle.hideClipButton) { const clipButton = document.querySelector( 'div#flexible-item-buttons yt-button-view-model button-view-model button[aria-label="클립"]', 'div#flexible-item-buttons yt-button-view-model button-view-model button[aria-label="Clip"]', 'div#flexible-item-buttons yt-button-view-model button-view-model button[aria-label="クリップ"]' ); if (clipButton) { clipButton.style.display = 'none'; // 클립 버튼 숨기기 } } if (featureToggle.hideDownloadButton) { const downloadButton = document.querySelector( 'ytd-download-button-renderer', 'ytd-menu-service-item-download-renderer' ); if (downloadButton) { downloadButton.style.display = 'none'; // 공유 버튼 숨기기 } } if (featureToggle.hideSaveButton) { const saveButton = document.querySelector( 'div#flexible-item-buttons yt-button-view-model button-view-model button[aria-label="재생목록에 저장"]', 'div#flexible-item-buttons yt-button-view-model button-view-model button[aria-label="Save"]', 'div#flexible-item-buttons yt-button-view-model button-view-model button[aria-label="保存"]' ); if (saveButton) { saveButton.style.display = 'none'; // (재생목록에) 저장 버튼 숨기기 } } if (featureToggle.hideChatWindow) { const chatWindow = document.querySelector( '#chat' ); if (chatWindow) { chatWindow.style.display = 'none'; // 공유 버튼 숨기기 } } } // 페이지 로드 시 버튼 숨기기 hideButtons(); // 페이지 변경 감지 시 클립 버튼 숨기기 const observer = new MutationObserver(hideButtons); observer.observe(document.body, { childList: true, subtree: true }); })();