Search code examples
ipadmobilemobile-safarixpageslotus

Hide Address bar for Xpages Mobile Web Application on Ipad (iOS5) and Mobile safari (v5.1)


With reference to the question I asked couple of days back, it seems to me that address bar cannot be hidden from a xpages mobile web application when it is launched from a href link. Choice is limited to href as "location.assign" or any javascript will not work on mails accessed by lotus traveller. I tried almost 20 different variations published by other experts to hide address bar and none seems to work. Am I wrong in stating that "it is not possible to hide address bar in Xpages mobile web application on ipad when not launched from home screen"?


Solution

  • The following works on iPhone and iPod Touch (and is similar to the solution I linked to in the answer to the other question that you mention).

    Create a client-side JavaScript library with the following logic:

    function hideAddressBar(){ window.scrollTo(0, 1)}
    
    window.addEventListener("load", hideAddressBar, false);
    

    Add the following to a layout custom control or similar in order for this to run on all the XPages where you want to hide the address bar (here I assume that the client-side JavaScript library is called addressbar.js:

    <xp:script clientSide="true" type="text/javascript" src="/addressbar.js"></xp:script>
    

    Have a look at the ITANA Tasks project on OpenNTF which uses this solution to hide the address bar.

    For iPad it is not possible to hide the address bar when running in Safari. To hide the address bar on iPad you need to launch the app from the home screen (and set the usual required meta tags).