Youtube Auto Expand Video Description! YT自动展开视频描述详细!
当前为
// ==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);