Greasy Fork is available in English.

去百度搜索置顶推广

去除插入在百度搜索结果头部的推广链接。

2015-05-22 일자. 최신 버전을 확인하세요.

// ==UserScript==
// @name	去百度搜索置顶推广
// @author	burningall
// @description	去除插入在百度搜索结果头部的推广链接。
// @version     2015.5.22-1.1
// @include		*www.baidu.com/s*
// @include		*www.baidu.com
// @supportURL		http://www.burningall.com
// @contributionURL	troy450409405@gmail.com|alipay.com
// @namespace https://greasyfork.org/zh-CN/users/3400-axetroy
// ==/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;"
    	 };
    };
  };
  function clearTime(){
  	var timer=setInterval(function(){
		remove();
		setTimeout(function(){
		clearInterval(timer);
		},3000)
  },20);
  };
  	remove();
	addEvent($("su"),'click',function(){
		clearTime();
	})
	addEvent($("kw"),'keyup',function(){
		clearTime();
	})
})()