var flag = false;
function disableLogo(urls, doc) {
if (!doc) {
doc = window.document;
}
console.log(1);
for ( var i in urls) {
var url = urls[i];
var links = doc.getElementsByTagName('a');
//外层
for (var i = 0; i < links.length; i++) {
var a = links[i];
if (a.href.indexOf(url) > 0) {
a.style.display = 'none';
flag = true;
}
}
//内层
var iframes = doc.getElementsByTagName('iframe');
if (iframes.length > 0) {
for (var i = 0; i < iframes.length; i++) {
var innerDoc = iframes[i].contentDocument;
disableLogo(urls, innerDoc);
}
}
}
}
var urls = [ 'wangmeng' ];
var timer = setInterval(function() {
disableLogo(urls, document);
if (flag && timer) {
clearInterval(timer);
}
}, 80);
0 回复
添加回复
请先登陆