您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
collapse youtube sidebar
当前为
- // ==UserScript==
- // @name Youtube Collapse Sidebar
- // @version 0.9
- // @description collapse youtube sidebar
- // @namespace https://greasyfork.org/users/821661
- // @match https://www.youtube.com/
- // @match https://www.youtube.com/results?*
- // @match https://www.youtube.com/@*
- // @icon https://cdn-icons-png.flaticon.com/512/7711/7711100.png
- // @author hdyzen
- // @run-at document-start
- // @inject-into page
- // @unwrap
- // @license MIT
- // ==/UserScript==
- (function () {
- ("use strict");
- window.addEventListener("DOMContentLoaded", function () {
- const sections = document.querySelector("#sections");
- function clickGuide() {
- document.querySelector("#guide-button").click();
- }
- const observer = new MutationObserver(function (mutations) {
- mutations.forEach(function (mutation) {
- if (mutation.type === "childList" && document.querySelector("#sections")) {
- clickGuide();
- observer.disconnect();
- }
- });
- });
- observer.observe(document.body, {
- childList: true,
- });
- });
- })();