查找网站引用的第三方js资源文件

2014/11/08 16:32
阅读数 362
for(var i=0,tags=document.querySelectorAll('iframe[src],frame[src],script[src],link[rel=stylesheet],object[data],embed[src]'),tag;tag=tags[i];i++){
    var a = document.createElement('a');
     a.href = tag.src||tag.href||tag.data;
    if(a.hostname!=location.hostname){
        console.warn(location.hostname+' 发现第三方资源['+tag.localName+']:'+a.href);
     }
}


展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
13 收藏
0
分享
返回顶部
顶部