try{ top.location.hostname; if (top.location.hostname != window.location.hostname) { top.location.href =window.location.href; } } catch(e){ top.location.href = window.location.href; }
文章转载:https://www.ruanyifeng.com/blog/2010/08/anti-frameset_javascript_codes_continued.html