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

默认的高度也太小了吧!

目前为 2024-03-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         【哔哩哔哩】修改选集列表框高度
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @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';

    // Default max-height value
    let maxHeight = GM_getValue('maxHeight', '257px');

    // Add menu command to set custom max-height
    GM_registerMenuCommand('修改高度值', function() {
        let userValue = prompt('请输入高度值:', maxHeight);
        if (userValue !== null) {
            maxHeight = userValue;
            GM_setValue('maxHeight', maxHeight);
            updateStyles();
        }
    });

    // Function to add/update styles to the page
    function updateStyles() {
        GM_addStyle(`
            .video-sections-content-list {
                height: auto !important;
            }
            .base-video-sections-v1 .video-sections-content-list {
                max-height: ${maxHeight} !important;
            }
        `);
    }

    // Initial style application
    updateStyles();
})();

QingJ © 2025

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