// ==UserScript==
// @name 隐藏哔哩哔哩动态中的侧边显示“体验新版”的组件
// @namespace XNEternal
// @version 0.1
// @description 自动隐藏哔哩哔哩动态中的侧边显示“体验新版”的组件
// @author XNEternal
// @match *://*.bilibili.com/*
// @grant none
// @license MIT
// @downloadURL none
// ==/UserScript==
//针对
(function() {
'use strict';
// 创建一个 MutationObserver 实例来监听DOM变化
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
// 检查新增的节点
if (mutation.addedNodes.length) {
hideVersionControlDiv();
}
});
});
// 开始观察目标节点
observer.observe(document.body, {
childList: true,
subtree: true
});
// 初始检查
hideVersionControlDiv();
function hideVersionControlDiv() {
const divs = document.querySelectorAll('.bili-dyn-version-control');
divs.forEach(div => {
div.style.display = 'none';
});
}
})();