lonely bilibili

remove some contents

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         lonely bilibili
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  remove some contents
// @author       You
// @match        https://www.bilibili.com/video/*
// @match        https://www.bilibili.com/bangumi/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @license MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    document.body.style.backgroundColor = 'white';

        // Configuration: Add the CSS selectors for the elements you want to prevent
    const selectorsToPrevent = ['#comment', '#danmukuBox'];

    // Function to remove the specified element
    const removeElement = (element) => {
        if (element) {
            element.remove();
        }
    };

    let elementsToDelete = ['#comment', '#v_tag', '#danmukuBox', '#reco_list', '.ad-report.video-card-ad-small', '.ad-report',
                            '#right-bottom-banner', '#activity_vote', '.pop-live-small-mode', '.bpx-player-sending-area'];

    // Function to observe DOM mutations
    const removeCommentElement = () => {

        elementsToDelete.forEach(function(elementId) {
        var element = document.querySelector(elementId);
            if (element) {
                element.remove();
            }
        });
    };

    function modifyElementStyleWithDelay() {
        setTimeout(function() {
            var element = document.querySelector('.video-sections-content-list');
            if (element) {
                element.style.height = 'auto';
                element.style.maxHeight = 'none';
            }
            let element2 = document.querySelector('#viewbox_report');
            if (element2) {
                element2.style.height = 'auto';
            }
        }, 2000); // Delay in milliseconds (3 seconds)
    }


    // Run the function to remove the comment element
    setTimeout(removeCommentElement, 1500);
    setTimeout(removeCommentElement, 3000);
    // setTimeout(removeCommentElement, 5000);
    modifyElementStyleWithDelay();

})();