How to detect iframe?

What’s the best way to detect whether my application is in iframe or not? I’m using vaadin 6.

window.parent might work. If you’re using JSNI (JavaScript Native Interface), remember that the actual window object of the app is referenced using the special
variable (the normal
references the iframe in which GWT code is running).