if (window.top !== window.self) { // are you trying to put self in an iframe?
try {
if (window.top.location.host) { // this is illegal to access unless you share a non-spoofable document domain
// fun times
} else {
bust(); // chrome executes this
}
} catch (ex) {
bust(); // everyone executes this
}
}
js判断当前窗口是否是顶级窗口
最新推荐文章于 2020-05-27 14:51:58 发布
本文介绍了一段用于检测浏览器窗口是否被嵌套在iframe中的JavaScript代码,并通过不同的浏览器特性来实现爆破操作,以此保护网站不被恶意嵌套。
1298

被折叠的 条评论
为什么被折叠?



