Skip to content

Instantly share code, notes, and snippets.

@mojaray2k
Created September 12, 2013 06:54
Show Gist options
  • Save mojaray2k/6533788 to your computer and use it in GitHub Desktop.
Save mojaray2k/6533788 to your computer and use it in GitHub Desktop.
Some sites like StumbleUpon and LinkedIn show your site with their bar on top of the page. This is done by including your page in an iframe. You only need to compare the window object of your page, to window.top. Normally, they are the same object, but if your site is being show in an iframe, they will differ. Then you simply re-direct the brows…
//no-iframe.js
if(window != window.top){
window.top.location = window.location;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment