https://union.dangdang.com/
广告图片
被植入的代码
网页被嵌入了iframe标签以及不属于你自己的script标签
请求里面多了很多莫名其妙的js
执行js还在报错。。。
解决方法
1.使用ssl证书加密【推荐,之后的方法治标不治本】
SSL证书免费申请流程,配置HTTPS重点是【免费】,我就是用的这个方法,之后就没有出现广告植入问题。
2.meta禁用iframe
<meta http-equiv="X-Frame-Options" content="DENY">
复制代码
3.js禁用iframe【列举一个】
<script type="text/javascript">
if(top.location!=self.location)top.location=self.location;
</script>
复制代码
4.css让iframe显示为空白
<style type="text/css">
iframe{ v:expression(this.src='about:blank',this.outerHTML='');}
</style>
复制代码
原因【丢锅】
这个锅要丢给路由器,应该路由器被人做了手脚,连WiFi试过好几个网站都谈广告出来,有ssl证书的网站没有出现过广告,用手机的4G也不会出这个问题。
转载:https://blog.youkuaiyun.com/weixin_33720452/article/details/91431546