Skip to content

Instantly share code, notes, and snippets.

@ralphholzmann
Created November 13, 2010 19:44
Show Gist options
  • Save ralphholzmann/675575 to your computer and use it in GitHub Desktop.
Save ralphholzmann/675575 to your computer and use it in GitHub Desktop.
Modernizr tests to detect if you're in an iframe or facebook iframe
Modernizr
.addTest('iframe', function() {
return window.top.location != window.location;
})
.addTest('facebook', function() {
return !! ~ location.href.indexOf( 'fb_sig_in_iframe=1' );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment