For some reason putting this inside a script tag works :
if(window.parent.parent===window.top){
//Redirect users to custom domain ( the page where you embbeded the web app)
}
Also, anyone came up with good anti-clickjacking techniques for embedded web apps ? I have a few ideas but they don't work as well.