Remove Bilibili Live Element

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

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

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