您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
B站各种分区删除排行关键字的视频推荐
当前为
// ==UserScript== // @name B站去除主页推荐排行榜视频 // @namespace http://tampermonkey.net/ // @version 0.2 // @description B站各种分区删除排行关键字的视频推荐 // @author a8105 // @match https://www.bilibili.com/ // @grant none // ==/UserScript== var regList=new Array(); regList[0]=new RegExp(".*排行.*"); regList[1]=new RegExp(".*数据可视.*"); (function() { 'use strict'; var list=getBiliAreas(); setInterval(function(){ for(var x=0;x<list.length;x++) { var viedoNode=getZone(getZoneModule(list[x])); checkViedos(viedoNode); } },5000); // Your code here... })(); function checkReg(title) { for(var x=0;x<regList.length;x++) { var reg=regList[x]; if(reg.test(title)) { return true; } } return false; } function checkViedos(node) { var removeList=new Array(); var index=0; for(var x=0;x<node.childNodes.length;x++) { if(node.childNodes[x].className=="spread-module") { var viedo=node.childNodes[x].childNodes[0].childNodes[1]; var title=viedo.getAttribute("title"); if(checkReg(title)) { console.log("查找到死妈排行榜标题:"+title+",进行人道毁灭"); removeList[index++]=x; } } } for(x=0;x<removeList.length;x++) { node.removeChild(node.childNodes[removeList[x]]); } } function getZone(node) { var subNode=null; for(var x=0;x<node.childNodes.length;x++) { if(node.childNodes[x].className=="new-comers-module l-con") { subNode=node.childNodes[x]; break; } } if(subNode==null) { return null; } for(x=0;x<subNode.childNodes.length;x++) { if(subNode.childNodes[x].className=="storey-box clearfix") { return subNode.childNodes[x]; } } return null; } function getZoneModule(node) { for(var x=0;x<node.childNodes.length;x++) { if(node.childNodes[x].className=="zone-module") { return node.childNodes[x]; } } return null; } function getBiliAreas() { var list=new Array(); var index=0; var appNode=getBiliNode(); if(appNode==null) { return list; } for(var x=0;x<appNode.childNodes.length;x++) { var a=hasArea(appNode.childNodes[x]); if(a==true) { list[index++]=appNode.childNodes[x]; } } return list; } function getBiliNode() { var childs=document.body.childNodes; for(var x=0;x<childs.length;x++) { console.log(childs[x].id); if(childs[x].id=="app") { var child=childs[x]; for(var y=0;y<child.childNodes.length;y++) { if(child.childNodes[y].className=="bili-wrapper") { return child.childNodes[y]; } } } } return null; } function hasArea(node) { for(var x=0;x<node.childNodes.length;x++) { if(node.childNodes[x].className=="zone-module") { return true; } } return false; }