您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Youtube Auto Grid: 1-2-3-4-5-6 columns layout
// ==UserScript== // @name Youtube auto grid // @namespace http://tampermonkey.net/ // @version 2025-05-03 // @description Youtube Auto Grid: 1-2-3-4-5-6 columns layout // @author You // @match https://www.youtube.com/ // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @grant none // @license MIT2 // ==/UserScript== (function() { 'use strict'; const css = ` .ytd-rich-grid-renderer { --ytd-rich-grid-items-per-row: 1 !important; } @media (max-width: 600px) { .ytd-rich-grid-renderer { --ytd-rich-grid-items-per-row: 2 !important; } } @media (min-width: 601px) and (max-width: 1026px) { .ytd-rich-grid-renderer { --ytd-rich-grid-items-per-row: 3 !important; } } @media (min-width: 1027px) and (max-width: 1665px) { .ytd-rich-grid-renderer { --ytd-rich-grid-items-per-row: 4 !important; } } @media (min-width: 1666px) and (max-width: 2000px) { .ytd-rich-grid-renderer { --ytd-rich-grid-items-per-row: 5 !important; } } @media (min-width: 2001px) { .ytd-rich-grid-renderer { --ytd-rich-grid-items-per-row: 6 !important; } } `; const style = document.createElement('style'); style.textContent = css; document.head.appendChild(style); })();