您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Scrollbar + more videos on main page.
当前为
// ==UserScript== // @name Videos scroller // @namespace http://tampermonkey.net/ // @version 0.1.2 // @description Scrollbar + more videos on main page. // @author Bum // @require http://code.jquery.com/jquery-3.4.1.min.js // @grant GM_addStyle // @match https://www.youtube.com/* // ==/UserScript== var itemsPerRow = 6; 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>"); $('div.scrollbar').bind('mousewheel DOMMouseScroll', function(e) { var scrollTo = null; if (e.type == 'mousewheel') { scrollTo = (e.originalEvent.wheelDelta * -1); } else if (e.type == 'DOMMouseScroll') { scrollTo = 40 * e.originalEvent.detail; } if (scrollTo) { e.preventDefault(); $(this).scrollTop(scrollTo + $(this).scrollTop()); } }); } (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(` ytd-rich-grid-renderer{ --ytd-rich-grid-items-per-row: ` + itemsPerRow + ` !important; } `); 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或关注我们的公众号极客氢云获取最新地址