Is Session in iFrame?

Just wondering if someone new the quickest/easiest way to tell if a WebSession is running in an iFrame. I want to change some behavior if so

This discussion seems to point to possible solutions:
https://stackoverflow.com/questions/3420004/access-parent-url-from-iframe#7739035

The idea to get window.parent.location seems fit. If it returns null, you know the app is not running in an iframe.

The best answer I’ve found so far is this:

https://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t

function inIframe () { try { return window.self !== window.top; } catch (e) { return true; } }

But I’ll have to hook it into WebControlWrapper EventListener object

It can be done within the framework as well. Check out http://documentation.xojo.com/api/web/webapplication.html#webapplication-security to set iframe settings.

Edit: It doesn’t look like there’s a “force top” setting though. Maybe a feature request for Web 2?

[quote=449587:@Tim Parnell]But I’ll have to hook it into WebControlWrapper EventListener object

[/quote]
Yup, I already had the app configured to allow iFraming but just wasn’t sure if there was a quick framework way to tell on the session. Doesn’t appear to be so, but definitely would be a nice feature. Looks like the hackaround ExecuteJavascript WebControlWrapper way is the solution for now.