Videos scroller

Adds a scrollbar to the list of videos on the player page

目前為 2019-07-12 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Videos scroller
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  Adds a scrollbar to the list of videos on the player page
// @author       Bum
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// @grant        GM_addStyle
// @match        https://www.youtube.com/*
// ==/UserScript==
jQuery(document).ready(_main);

function _main ()
{
    var isReady = jQuery("div.ytd-watch-next-secondary-results-renderer").length > 0;
    if (!isReady) {
        setTimeout(_main, 500);
        return;
    }

        jQuery("div.ytd-watch-next-secondary-results-renderer").wrap("<div id='style-3' class='scrollbar'></div>");
}

(function() {
    function GM_addStyle(css) {
        const style = document.getElementById("GM_addStyle") || (function() {
            const style = document.createElement('style');
            style.type = 'text/css';
            style.id = "GM_addStyle";
            document.head.appendChild(style);
            return style;
        })();
        const sheet = style.sheet;
        sheet.insertRule(css, (sheet.rules || sheet.cssRules || []).length);
    }
    GM_addStyle ( `
.scrollbar
{
	margin-left: 30px;
    max-height: 800px;
	float: left;
	overflow-y: scroll;
	margin-bottom: 25px;
}
` );GM_addStyle ( `
   #style-3::-webkit-scrollbar-track
{
	-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
	background-color: #F5F5F5;
}
` );GM_addStyle ( `
#style-3::-webkit-scrollbar
{
	width: 6px;
	background-color: #F5F5F5;
}
` );GM_addStyle ( `
#style-3::-webkit-scrollbar-thumb
{
	background-color: #000000;
}
` );
})();

QingJ © 2025

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