您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
B站去广告
// ==UserScript== // @name B站去除动态首页的up主推广 // @namespace http://tampermonkey.net/ // @version 0.1 // @description B站去广告 // @author You // @match https://t.bilibili.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=bilibili.com // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Your code here... //window.onscroll = throttle(function() { // clear() //}, 500) const t = setInterval(() => { clear() }, 500) function clear() { document.querySelectorAll('.bili-dyn-list__item').forEach(item => { const keywordString = '拼多多 淘宝 京东 领红包 妙界 小破站 手淘 领取 优惠 下单 补贴 囤起来 神价 新品 抽奖 神车 补贴 啄木鸟 旗舰店 元起 元抢 元到手 私一下 9抢 羊毛 天猫 U型枕 某宝 大促 价格 领券 芒 石榴 发货 流量 运费 质保 库存 送礼 试试哦 到手'; if (keywordString.split(' ').filter(keyword => keyword !== '').some(keyword => item.innerText.includes(keyword))) { item.style.display = 'none'; // 如果是 DOM 元素,可以这样隐藏 } }) } function throttle(func, delay) { let last; return function () { const _this = this; const _args = arguments; const now = +new Date(); if (last && now < last + delay) { clearTimeout(func.tid); func.tid = setTimeout(function () { last = now; func.call(_this, [..._args]); }, delay); } else { last = now; func.call(_this, [..._args]); } } } })();