YouTube in compact

Show 6 video in row on YouTube top page!

目前為 2020-06-06 提交的版本,檢視 最新版本

// ==UserScript==
// @name         YouTube in compact
// @name:ja         YouTube in compact
// @namespace    http://tampermonkey.net/
// @version      0.4.1
// @description  Show 6 video in row on YouTube top page!
// @description:ja  トップページ上で1段に6つのサムネを表示させるよ!
// @author       Alex.nfo
// @match        *://www.youtube.com/*
// @exclude      *://www.youtube.com/watch?v=*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // an event lister for detecting window size changing
    window.addEventListener( 'resize', function() {
        if ( window.innerWidth >= window.parent.screen.width * 0.75 ) { // change MAX video showing on the ROW if screenwidth is big enough(over 75%)
            document.getElementsByTagName("ytd-rich-grid-renderer")[0].style = "--ytd-rich-grid-items-per-row:6; --ytd-rich-grid-posts-per-row:3; --ytd-rich-grid-movies-per-row:7";
            document.getElementsByTagName("html")[0].style = "font-size: 9px;font-family: Roboto, Arial, sans-serif; ";

        } else { //if not, set back to original
            document.getElementsByTagName("ytd-rich-grid-renderer")[0].style = "";

        }

    }, false );
})();

QingJ © 2025

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