// ==UserScript== // @name 屏蔽bilibili首页推荐(PC) // @namespace http://tampermonkey.net/ // @version 2024-04-19 // @description try to take over the world! // @author You // @match https://www.bilibili.com/ // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net // @grant none // ==/UserScript== (function() { let isBanRecommend = false; 'use strict'; console.info("启动屏蔽"); document.querySelector(".bili-feed4-layout").style.display="none"; let timer = setInterval(()=>{ const headerChannel = document.querySelector(".header-channel"); if(headerChannel){ setTimeout(()=>{ headerChannel.style.display="none"; },10); console.info("屏蔽难看的头部和搜索推荐,呃呃呃呃呃"); clearInterval(timer); timer = null; } },10); // Your code here... const searchInput = document.querySelector(".nav-search-input"); searchInput.addEventListener("click", function(){ console.info("点击了搜索栏!"); let timer = setInterval(()=>{ const trendingEle = document.querySelector(".trending"); if(trendingEle){ console.info("bilibili正在查询趋势信息 ...."); trendingEle.style.display = "none"; clearInterval(timer); timer = null; } },10); }); const biliBody = document.body; const divElement = document.createElement("div"); divElement.innerText = "看真正有用的东西!"; divElement.style.fontSize = "48px"; divElement.style.color = "#ffaaaa"; divElement.style.textAlign = "center"; divElement.style.margin = "20px auto"; biliBody.appendChild(divElement); })();