百度经验不需要
// ==UserScript== // @name 不要百度经验的内容 // @namespace http://tampermonkey.net/ // @version 0.5 // @description 百度经验不需要 // @author Exisi // @match *://www.baidu.com/* // @grant none // @supportURL // ==/UserScript== (function () { baiduDiabledPreload(); let nodeList = document.getElementsByClassName("r###lt c-container new-pmd"); //获取搜索项 if (nodeList != null) { for (let i in nodeList) { const t = nodeList[i].textContent; //文本内容 if (t != null && t.search(/(百度经验)|(jingyan.baidu.com)/g) > 0) { nodeList[i].style.display = "none"; } } } function baiduDiabledPreload() { let page_btn = document.getElementsByClassName("page-inner_2jZi2")[0].getElementsByTagName("a"); if (page_btn != null) { for (let i in page_btn) { if (page_btn[i] != null) { page_btn[i].onclick = function () { setTimeout("location.reload()", 100); } } } } let submit_btn = document.getElementsByClassName("bg s_btn_wr")[0]; if (submit_btn != null) { submit_btn.onclick = function () { setTimeout("location.reload()", 500); } } } })();