您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
zh-cn
当前为
// ==UserScript== // @name 移除B站热搜框 // @namespace http://tampermonkey.net/ // @version 0.1 // @match *://www.bilibili.com/ // @match *://*.bilibili.com/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @description zh-cn // ==/UserScript== (function () { let app = document.getElementById("app"); if (app == null){ return } //设置监听dom改变类型 let config = { //子节点 "childList":true, //后代节点 "subtree":true }; let mutationObserver = new MutationObserver(function (records,mutationObserver){ records.forEach(function (record) { for (let i = 0;i<record.addedNodes.length;i++){ let node = record.addedNodes[i]; //判断是否是HTML节点 if (node.nodeType == 1) { //找到热搜所在的节点 if (node.getAttribute("class") == "trending") { //设为隐藏 node.style.display = "none" mutationObserver.takeRecords(); } } } }); }); //监听dom节点变化 mutationObserver.observe(app,config); })();