百度去搜索推广

enter something useful

目前为 2015-05-22 提交的版本。查看 最新版本

// ==UserScript==
// @name        百度去搜索推广
// @namespace    http://your.homepage/
// @version      0.2
// @description  enter something useful
// @author       You
// @match        http://*/*
// @include     *baidu.com/*
// @grant        none
// ==/UserScript==

(function() {
    function $(id) {
        return document.getElementById(id);
    };
    function addEvent(obj, event, fn) {
	return obj.addEventListener ? obj.addEventListener(event, fn, false) : obj.attachEventListener('on' + event, fn);
	};
	function remove(){
    adlist = $('content_left').children;
    for (var i=0;i<adlist.length;i++) {
    	 if(adlist[i].getAttribute("id")>1000){
    	 	adlist[i].style.cssText="display: none !important;"
    	 };
    	 if(adlist[i].getAttribute("id")==null){
    	 	adlist[i].style.cssText="display: none !important;"
    	 };
    };
  };
  	remove()
	addEvent($("su"),'click',function(){
		remove()
	})
})()