I want to redirect all traffic to my Facebook application tab on my server directly to my Facebook application. Therefore, I check the following code if the user is inside a Facebook iframe or on my web page:
<!-- language: lang-js --> function referrerIsFacebookApp() { if(document.referrer) { return document.referrer.indexOf("facebook.com") !== -1; } return false; } if (!referrerIsFacebookApp()) { top.location.replace("https://www.facebook.com/bommelME/app_264697733636385"); };
If I open the page in the browser, everything will work as it should. But if I link to this page and open the link, the redirect does not work. Any clues?
source share