/* eslint-disable strict */ // ==UserScript== // @name B站顽固广告移除 // @version 0.0.1.20221218 // @namespace laster2800 // @author Laster2800 // @description 移除B站那些无法通过 AdGuard 等扩展移除的广告(普通广告不处理) // @icon https://www.bilibili.com/favicon.ico // @homepageURL https://greasyfork.org/zh-CN/scripts/TODO // @supportURL https://greasyfork.org/zh-CN/scripts/TODO/feedback // @license LGPL-3.0 // @noframes // @include *://search.bilibili.com/* // @require https://greasyfork.org/scripts/409641-userscriptapi/code/UserscriptAPI.js?version=1081030 // @require https://greasyfork.org/scripts/432002-userscriptapiwait/code/UserscriptAPIWait.js?version=1129540 // @grant none // @run-at document-start // @downloadURL none // ==/UserScript== /* global UserscriptAPI */ const selector = 'a[href*="cm.bilibili.com"][data-target-url]:not([data-target-url*=".bili"])' const callback = identity => { identity.closest('.bili-video-card').parentElement.style.display = 'none' } new UserscriptAPI().wait.executeAfterElementLoaded({ selector, callback, multiple: true, repeat: true, timeout: 0 })