3

I don't want to know if a my game is played inside android app android browser. I just want to know the url.

This is for a game website. I am using location.hostname to find the hostname. 1. for example if a website name is gameexample.com and the user goes to this site directly location.hostname shows correctly (gameexample.com) and if the game is played inside facebook, location.hostname shows same gameexample.com.

So tried window.top.location.hostname but this works in normal website but in facebook it logs(in the console) following message.

Stop!

This is a browser feature intended for developers. If someone told you to copy-paste something here to enable a Facebook feature or "hack" someone's account, it is a scam and will give them access to your Facebook account.

See https://www.facebook.com/selfxss for more information.

My question is how do I find if a game is played inside a facebook. I want the url.

Update: My ajax request is also not sent if the game is played inside facebook shows the same error message.

Thanks in advance

scriptkiddie
  • 585
  • 2
  • 8
  • 24

0 Answers0