I'm working on a GWT application, which should behave in a slightly different manner when it is running inside a frame and when running directly in a browser window. The question is: how to determine at runtime whether we're in a frame or in a window?
Wrap a bit of javascript into JSNI:
public static native boolean isFrame() /*-{
return ($wnd!=$wnd.top);
}-*/;