您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Youtube Auto Show Live Chat Replay, YT自动展开直播聊天回放
// ==UserScript== // @name Youtube - Auto Show Live Chat Replay // @namespace http://tampermonkey.net/ // @version 2.7 // @description Youtube Auto Show Live Chat Replay, 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 = null; let $__videoId = null; const showLiveChatClick = (async (expandObj) => { expandObj.click(); }); const idCheckLiveChatInterval = setInterval(() => { let url = document.URL; if($url!=url){ $__videoId = null; $url=url; } 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 expandObjArray = document.getElementsByClassName("yt-spec-button-shape-next"); for (let i = 0; i < expandObjArray.length; i++) { let expandObj = expandObjArray[i]; let id = expandObj.parentElement.parentElement.parentElement.id; if (id == "show-hide-button") { let chatObj = document.querySelector("#chat"); if (chatObj.hasAttribute("collapsed")) { showLiveChatClick(expandObj); } else { console.warn("Live Chat Expanded!"); $__videoId = videoId; } } } } }, 100);