【哔哩哔哩】修改选集列表框高度

默认的高度也太小了吧!

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

// ==UserScript==
// @name         【哔哩哔哩】修改选集列表框高度
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  默认的高度也太小了吧!
// @author       AkagiYui
// @license      MIT
// @match        https://www.bilibili.com/video/*
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @grant        GM_setValue
// @grant        GM_getValue
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    let maxHeight = GM_getValue('maxHeight', '340px');

    GM_registerMenuCommand('修改高度值', function() {
        let userValue = prompt('请输入高度值:', maxHeight);
        if (userValue !== null) {
            maxHeight = userValue;
            GM_setValue('maxHeight', maxHeight);
            updateStyles();
        }
    });

    function updateStyles() {
        GM_addStyle(`
            .video-sections-content-list {
                height: auto !important;
            }
            .base-video-sections-v1 .video-sections-content-list {
                max-height: ${maxHeight} !important;
            }
            .multi-page-v1 .cur-list {
                max-height: ${maxHeight} !important;
            }
        `);
    }

    updateStyles();
})();

QingJ © 2025

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