Greasy Fork

来自缓存

去除百度搜索广告

去除百度搜索推广、广告

目前为 2016-09-21 提交的版本。查看 最新版本

// ==UserScript==
// @name         去除百度搜索广告
// @namespace    http://tampermonkey.net/
// @version      0.1.3
// @description  去除百度搜索推广、广告
// @author       大雄、小虾吃大虾
// @match        https://www.baidu.com/*
// @grant        none
// ==/UserScript==

setTimeout(function(){
    startAD();
},700);

function startAD(){
    setInterval( function (){
        var container = document.getElementById( 'content_left' );
        Array.from( container.children).forEach( function ( item ){
            if( item && /display:block\s+!important;visibility:visible\s+!important/i.test( item.getAttribute( 'style' ) ) ){
                this.removeChild( item );
            }
        }, container );
    }, 300 );
}