Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible hide iOS browser chrome on a normal webpage

Tags:

browser

ios

hide

So you can make a website go "full screen" and hide the addressbar/chrome on ipad if the user adds your page to their home screen, which makes an icon on the home screen that they launch your site from. You just put some meta tags like this:

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

However, I haven't been able to get a site to hide the browser chrome when the page is just in a normal browsing session (the user hasn't launched your site directly from an icon on their home screen). Is it possible to do so? How?

like image 483
Rafe Avatar asked Jun 22 '11 13:06

Rafe


People also ask

Is Chrome on iOS actually Chrome?

As you might have heard, Google Chrome is now available for the iPhone and iPad, but before you get too excited, you need to realize that it isn't Chrome at all. It's Apple's Safari with a 'chrome' interface. The actual browser, the rendering, and javascript engine is 100% Apple Safari.

How do I hide my browser in Chrome?

You can also use a keyboard shortcut to open an Incognito window: Windows, Linux, or Chrome OS: Press Ctrl + Shift + n. Mac: Press ⌘ + Shift + n.

How do I hide the mobile browser 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.


2 Answers

According to the Apple Docs it doesn't specifically say you can't (however as you've noted, it appears to only behave as desired when the site has been added to your home screen).

I also noted that on the Apple Support Forum the consensus seems to be that you need to launch from the home screen to get the desired effect.

Quote from Docs:

apple-mobile-web-app-capable

Sets whether a web application runs in full-screen mode.

Syntax

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

Discussion

If content is set to yes, the web application runs in full-screen mode; otherwise, it does not. The default behavior is to use Safari to display web content.

You can determine whether a webpage is displayed in full-screen mode using the window.navigator.standalone read-only Boolean JavaScript property.

Availability

Available in iOS 2.1 and later.

like image 171
scunliffe Avatar answered Oct 18 '22 04:10

scunliffe


I found this works,

$('body').delay('1000').animate({ scrollTop: '0px' }, 'slow');

I noticed that scrolling down removed it, so scrolled 60px (height of the chrome), but that hide it and scrolled down the page, but a scroll of 0px, assuming your page has started at the top (not on a # target), fools it!

I guess you could even remove the delay and animate, but I wanted it to be smooth, and not too jerky.

like image 26
Will Hancock Avatar answered Oct 18 '22 02:10

Will Hancock