Remove Bilibili Live Element

自动删除Bilibili直播页面上的特定特定元素(移除B站直播间马赛克)

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Remove Bilibili Live Element
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  自动删除Bilibili直播页面上的特定特定元素(移除B站直播间马赛克)
// @author       佐仓
// @match        *://live.bilibili.com/*
// @grant        none
// @license      none
// ==/UserScript==

(function() {
    'use strict';

    // 创建一个观察器实例来监视DOM变化
    const observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            // 查找并删除具有特定 id 的元素
            var element = document.getElementById('web-player-module-area-mask-panel');
            if (element) {
                element.remove();
                // 元素删除后可以停止观察
                observer.disconnect();
            }
        });
    });

    // 配置观察器
    const config = { childList: true, subtree: true };

    // 选择页面的根节点进行观察
    observer.observe(document.body, config);

    // 初始检查
    var initialElement = document.getElementById('web-player-module-area-mask-panel');
    if (initialElement) {
        initialElement.remove();
    }
})();