Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide address bar in mobile device browser

I know 1 way of doing this.

<body onload="setTimeout(function() {window.scrollTo(0, 1)}, 100)"> ... </body> 

But this works only if the page is big enough to be scrolled. If the page fits the screen the above function wont work. How to hide the address bar in this case ? I need to get it to work with iphone, ipad, android devices.

like image 731
Prabhat Avatar asked May 02 '11 10:05

Prabhat


People also ask

How do I hide mobile browser in address bar?

To get started enter “about:flags” into the Address Bar and hit Enter. Scroll down until you see the listing for Compact Navigation. Enable it and let the browser restart to gain access to the feature. Once the browser has restarted right click on one of the tabs and select Hide the toolbar from the Context Menu.

Where is address bar in mobile?

The address bar is displayed on top of the navigation controls and buttons for managing tabs, sharing, and other app settings.

How do I hide my browser bar?

Switch to full-screen mode Another simple way to hide the URL bar in Chrome is to go full-screen by pressing F11 or Fn + F11 , depending on whether the Function (Fn) key is locked or unlocked. Remember that this method will hide the tabs as well and only open the current tab in full-screen mode.


2 Answers

Maybe you can set the minheight on the body bigger. 480px screen height in vertical mode + 60px address bar height = 540px.

Example:

body { min-height:540px; }      body[orient="portrait"] { min-height:540px; } body[orient="landscape"] { min-height:400px; } 
like image 186
Tom Claus Avatar answered Sep 21 '22 19:09

Tom Claus


iPhone:

Works only if the mobile "app" is added to the homescreen (through the plus-icon -> add to homescreen)

<meta name="apple-mobile-web-app-capable" content="yes" /> 

I have no experience with other mobile OS'es, but a quick Google-search for hide browser url bar android resulted in a similar solution to yours, with a window.scrollTo.

like image 21
sanderd Avatar answered Sep 21 '22 19:09

sanderd