I am trying to hide the address bar of my GWT app on mobile devices. From my mobile code I am calling the JSNI function below, but it doesn't work. Any solution you can think of which doesn't involve JQuery?
public static native void hideBar()
/*-{
$($doc).ready(function() {
function hideAddressBar() {
if($doc.documentElement.scrollHeight < $wnd.outerHeight / $wnd.devicePixelRatio) {
$doc.documentElement.style.height = ($wnd.outerHeight / $wnd.devicePixelRatio) + "px";
}
}
$wnd.addEventListener("load", function() { hideAddressBar(); });
$wnd.addEventListener("orientationchange", function() { hideAddressBar(); });
});
}-*/;