Youtube Auto Expand Video Description! YT自动展开视频描述详细!
当前为
// ==UserScript==
// @name Youtube - Auto Expand Video Description
// @namespace http://tampermonkey.net/
// @version 2.1
// @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 __$videoId = "";
//Async
const expandDescriptionClick = (async (expandObj) => {
expandObj.click();
});
//Loop
const videoIdCheckDesInterval = setInterval(() => {
let video_des = document.getElementsByClassName("watch-active-metadata style-scope ytd-watch-flexy style-scope ytd-watch-flexy")[0];
let videoId = "";
if (video_des) {
videoId = video_des.getAttribute("video-id");
}
if (__$videoId != videoId) {
let expandObj = video_des.querySelector("#expand");
let collapseObj = video_des.querySelector("#collapse");
expandDescriptionClick(expandObj);
if (collapseObj.checkVisibility()) {
console.warn("Description Expanded!");
__$videoId = videoId;
}
}
}, 100);