您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Video description and long comments are expanded automatically
当前为
// ==UserScript== // @name Youtube: expand description and replies // @description Video description and long comments are expanded automatically // @author MK // @namespace max44 // @homepage https://greasyfork.org/en/users/309172-max44 // @match *://*.youtube.com/* // @match *://*.youtu.be/* // @icon https://cdn.icon-icons.com/icons2/1488/PNG/512/5295-youtube-i_102568.png // @version 1.0.4 // @license MIT // @grant none // @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @run-at document-idle // ==/UserScript== //TO DO: when you select "View all N replies" you will get all of them without necessity to click "view more comments" all the time (function () { 'use strict'; var urlAtLastCheck = ""; var nameAtLastCheck = ""; var btnClick = null; var i; setInterval(function() { //Check page content constantly //Check whether URL and channel name have changed. If yes, clear the attribute clicked-by-script, because it survives change of the page if (urlAtLastCheck != window.location.href && nameAtLastCheck != document.title) { urlAtLastCheck = window.location.href; nameAtLastCheck = document.title; btnClick = $( "div#description ytd-text-inline-expander tp-yt-paper-button#expand[role='button'][clicked-by-script='true']" ); if (btnClick != null && btnClick.length > 0) btnClick[0].removeAttribute("clicked-by-script"); btnClick = $( "div#meta-contents ytd-video-secondary-info-renderer div ytd-expander tp-yt-paper-button#more[clicked-by-script='true']" ); if (btnClick != null && btnClick.length > 0) btnClick[0].removeAttribute("clicked-by-script"); } //Check whether description has been expanded by another script or addon. If yes, mark it as if it was expanded by the script to avoid double processing btnClick = $( "div#description ytd-text-inline-expander tp-yt-paper-button#expand[role='button']:not([clicked-by-script='true'])[hidden='']" ); //Description was expanded by another script or addon if (btnClick != null && btnClick.length > 0) { btnClick[0].setAttribute("clicked-by-script", "true"); //Do not click it again } //Expand description btnClick = $( "div#description ytd-text-inline-expander tp-yt-paper-button#expand[role='button']:not([clicked-by-script='true']):not([hidden=''])" ); if (btnClick != null && btnClick.length > 0) { btnClick[0].click(); btnClick[0].setAttribute("clicked-by-script", "true"); //Do not click it again } //Expand description for 7ktTube | 2016 REDUX script btnClick = $( "div#meta-contents ytd-video-secondary-info-renderer div ytd-expander tp-yt-paper-button#more:not([clicked-by-script='true'])" ); if (btnClick != null && btnClick.length > 0) { btnClick[0].click(); btnClick[0].setAttribute("clicked-by-script", "true"); //Do not click it again } //Expand replies and hide "show less" button btnClick = $( "#primary ytd-comment-renderer #comment-content tp-yt-paper-button#more:not([hidden='']) > span.more-button[slot='more-button']:not([clicked-by-script='true'])" ); if (btnClick != null) { for (i = 0; i < btnClick.length; i++) { btnClick[i].click(); btnClick[i].setAttribute("clicked-by-script", "true"); //Do not click it again btnClick[i].parentNode.previousElementSibling.setAttribute("style", "display:none;"); //Hide "Show less" button } } //Expand post in community section btnClick = $( "div#post ytd-expander#contentTextExpander tp-yt-paper-button#more[role='button']:not([clicked-by-script='true']):not([hidden=''])" ); if (btnClick != null && btnClick.length > 0) { btnClick[0].click(); btnClick[0].setAttribute("clicked-by-script", "true"); //Do not click it again } }, 250); //Interval to check page content })();