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 browser directly to your site.