try {
// 获取顶级对象
top.location.hostname;
// 兼容chrome
if (top.location.hostname != window.location.hostname) {
top.location.href = window.location.href;
}
} catch (e) {
// 如果报错就重定向到自己的网站
top.location.href = window.location.href;
}
网友评论