Youtube - Auto Expand Video Description

Youtube Auto Expand Video Description! YT自动展开视频描述详细!

目前为 2024-07-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         Youtube - Auto Expand Video Description
// @namespace    http://tampermonkey.net/
// @version      2.2
// @description  Youtube Auto Expand Video Description! YT自动展开视频描述详细!
// @author       Martin______X
// @match        https://www.youtube.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant        none
// @license      MIT
// ==/UserScript==

let $URL = "";
/*ASYNC*/
const simpleClick = (async (obj) => {
    obj.click();
});
/**/
const checkURLInterval = setInterval(() => {
    try{
        let URL = document.URL;
        if ($URL !== URL) {
            /**/
            window.scrollTo({ top: 0, behavior: "instant" });
            /**/
            let video_description = document.getElementsByClassName("watch-active-metadata style-scope ytd-watch-flexy style-scope ytd-watch-flexy")[0];
            let expand = video_description.querySelector("#expand");
            let collapse = video_description.querySelector("#collapse");
            /**/
            simpleClick(expand);
            /**/
            if (collapse.checkVisibility()) {
                console.warn("Description Expanded!");
                $URL = URL;
                document.html.focus();
            }
        }
    }catch(error){
        //console.warn(error);
    }
}, 1);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址