您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This is a script for removing advertisements and junk information from web pages in Baidu.
当前为
// ==UserScript== // @name 百度页面净化 // @namespace https://sfkgroup.github.io/ // @version 0.1 // @description This is a script for removing advertisements and junk information from web pages in Baidu. // @author SFKgroup // @match http://*.baidu.com/* // @match https://*.baidu.com/* // @grant GM_log // @icon https://sfkgroup.github.io/images/favicon.ico // @license LGPL // ==/UserScript== (function() { 'use strict'; var k = 0 var deny = ['b2b_prod','sp_hot_sale','news-realtime','short_video','game-page-profession','game-page-platform','pc-soft-accurate','pc-soft-fs','bjh_addressing','law_consult_card',undefined ,null] self.setInterval(function (){ try{ var rubbish = document.getElementById('s_wrap') if (rubbish) { rubbish.remove() }; rubbish = document.getElementsByClassName("blank-frame") if (rubbish[0]) { rubbish[0].remove() setTimeout("document.querySelector('#header > div:nth-child(7)').remove()", 300 ) } rubbish = document.getElementById('content_right') if (rubbish) { rubbish.remove() }; rubbish = document.getElementsByClassName("aside-inner") if (rubbish[0]) { rubbish[0].remove() } rubbish = document.querySelector("#app > div.base-layout-content > div.base-layout-content-left > div.search-result-list-wrap") if (rubbish) { for (k=0;k<rubbish.children.length;k++) { if (rubbish.children[k].getAttribute("class") == null){rubbish.children[k].remove()} } } rubbish = document.querySelector("#page-main > div > div > div > div.list-header") if (rubbish) { rubbish.remove() }; rubbish = document.querySelector("#ssr-content > div._2jN0Z > div > div._2v051 > div") if (rubbish) { for (k=0;k<rubbish.children.length;k++) { if (rubbish.children[k].getAttribute("class") == null){rubbish.children[k].remove()} } } rubbish = document.querySelector("#thread_list") if (rubbish) { for (k=0;k<rubbish.children.length;k++) { if (rubbish.children[k].getAttribute("data-thread-type") == null){rubbish.children[k].remove()} } } rubbish = document.getElementById("qbrightdown-wapqbbrand") if (rubbish) { rubbish.remove() }; rubbish = document.getElementsByClassName("wgt-ads answerlist") if (rubbish[0]) { rubbish[0].remove() }; rubbish = document.getElementsByClassName("newbest-content-meta line ff-arial") if (rubbish[0]) { rubbish[0].remove() }; rubbish = document.getElementsByClassName("wgt-ads qbleftdown") if (rubbish[0]) { rubbish[0].remove() }; rubbish = document.getElementsByClassName("comp-vip-pop inner-vip") if (rubbish[0]) { rubbish[0].remove() }; rubbish = document.getElementsByClassName("vip-privilege vip-privilege-card-wrap new-privilege-wrap") if (rubbish[0]) { rubbish[0].remove() }; rubbish = document.getElementsByClassName("vip-layer-inner") if (rubbish[0]) { rubbish[0].remove() }; rubbish = document.getElementsByClassName("j_click_stats") if (rubbish[0]) { rubbish[0].remove() }; rubbish = document.getElementById('pagelet_frs-aside/pagelet/aside_ad') if (rubbish) { rubbish.remove() }; var divs = document.querySelector("#content_left") if (divs){ for (var i=0;i<divs.children.length;i++) { GM_log(divs.children[i].getAttribute("class")) if (deny.includes(divs.children[i].getAttribute("tpl")) && divs.children[i].getAttribute("class") != 'video_list_container content_default content1 video-no-tag'){ divs.children[i].remove() //divs.children[i].setAttribute("style","filter:Gray; -webkit-filter: grayscale(100%); filter:blur(10px)") } else if (divs.children[i].getAttribute("class") == 'result c-container new-pmd') { divs.children[i].remove() //divs.children[i].setAttribute("style","filter:Gray; -webkit-filter: grayscale(100%); filter:blur(10px)") } } } } catch (e) {GM_log(e)} },500); })();