lonely bilibili

remove some contents

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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();

})();