// ==UserScript== // @name 屏蔽B站首页广告推荐 // @namespace https://greasyfork.org/zh-CN/users/810690-twinsdestiny // @version 0.2 // @description 屏蔽B站首页广告推荐(有广告和火箭标志的) // @author TwinsDestiny // @match *://*.bilibili.com/* // @require https://cdn.jsdelivr.net/npm/arrive@2.4.1/minified/arrive.min.js // @require https://code.jquery.com/jquery-2.2.4.min.js // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @license MIT // @downloadURL none // ==/UserScript== (async function () { 'use strict'; // 隐藏 await document.arrive('body', { fireOnAttributesModification: false, onceOnly: false, existing: true }, async function () { setInterval(function () { // 弹出游戏广告 $(".adcard").each(function () { var ad = $(this).find(".palette-button-adcard"); if (ad.length > 0) { $(this).remove(); } }); //首页广告 $(".bili-video-card").each(function () { //广告标记 var authorSpan = $(this).find(".bili-video-card__info--ad"); if (authorSpan.length > 0) { $(this).remove(); } //火箭推送 var rocket = $(this).find(".bili-video-card__info--creative-ad"); if (rocket.length > 0) { $(this).remove(); } }); }, 500); }); })();