更新 'baidu/clearAd.user.js'

This commit is contained in:
502647092 2019-01-08 14:36:10 +08:00
parent 9dbef3e603
commit 0308fd9b81

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name 百度广告去除 // @name 百度广告去除
// @namespace http://ide.yumc.pw/ // @namespace http://ide.yumc.pw/
// @version 0.0.1 // @version 0.0.2
// @description 去除百度上下推广广告 // @description 去除百度上下推广广告
// @author MiaoWoo // @author MiaoWoo
// @include http*://*.baidu.* // @include http*://*.baidu.*
@ -10,13 +10,16 @@
// ==/UserScript== // ==/UserScript==
(function() { (function() {
'use strict'; 'use strict';
function clear(){
var content = document.getElementById('content_left') var content = document.getElementById('content_left')
var result = content.childNodes; var result = content.childNodes;
for (var i = 0; i<result.length;i++){ for (var i = 0; i<result.length;i++){
var c = result[i] var c = result[i]
if (c.className != "result c-container "){ if (c.className != "result c-container "){
content.removeChild(c) content.removeChild(c)
} }
} }
}
setTimeout(clear, 300)
})(); })();