lonely bilibili

remove some contents

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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();

})();