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;
}
ref:http://www.ruanyifeng.com/blog/2010/08/anti-frameset_javascript_codes_continued.html
if (self!=top){ window.top.location.replace(self.location); //打开自己网站的页面 }
ref:https://blog.csdn.net/shaerdong/article/details/53208511