Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone 5s - iOS 9.0.2 - safari - Hide address bar when landscape mode

Is there any way to remove safari address bar in iOS 9.0.2?

I have tried below things to hide address bars but no success.

1. added metatag.

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">

2. added JS code.

    window.addEventListener("load",function() {
      // Set a timeout...
      setTimeout(function(){
        // Hide the address bar!
        window.scrollTo(0, 1);
      }, 0);
    });

But no success. can anyone help me with this?

like image 260
Rukmi Patel Avatar asked Nov 09 '22 02:11

Rukmi Patel


1 Answers

The only way I know is to use your website as a web app. You have to add in your header the following:

Add this for IOS

<meta name="apple-touch-fullscreen" content="yes">

and for Android

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

after add your web site to Home screen. It will create an icon on your iPhone screen and when you click on it, the app will start in full screen mode without the address bar

Update 2019:

This might not be relevant anymore, please consider Progressive Web App

https://developers.google.com/web/progressive-web-apps/

like image 96
ursuleacv Avatar answered Nov 14 '22 21:11

ursuleacv