您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
百度搜索去广告,优化百度搜索,简单粗暴
// ==UserScript== // @name 百度搜索去广告 // @namespace gstsgy // @version 0.0.2 // @description 百度搜索去广告,优化百度搜索,简单粗暴 // @author You // @match https://www.baidu.com/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; console.log('百度,我来了') setInterval(()=>{ const spanAll = document.querySelectorAll("span") for (const span of spanAll) { if (span.textContent === "广告") { const div10 = span.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; if(div10!==null){ div10.remove(); } } } //console.log("aaaaa") const aall = document.querySelectorAll("a") for (const a of aall) { if (a.textContent === "广告") { const div10 = a.parentNode.parentNode; if(div10!==null){ div10.remove(); } } } const divs = document.querySelectorAll("div") for(const div of divs){ const preTextContent = div.textContent.substring(0,20); if(preTextContent.indexOf("本地惠生活")!==-1){ div.remove() } } const right = document.querySelector("#content_right") if(right!==null){ right.remove(); } },500) })();