Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webapp hide Android navigation bar (virtual back, homescreen etc. buttons) in Chrome (via javascript)

I am making a webapp and would like to create a true fullscreen experience. For Android this includes hiding both the Chrome address bar on top and the navigation bar at the bottom (the virtual back, home and multitask buttons).

I have looked through the fullscreen api, fulscreen experiences article and screenfull.js. All of these implement hiding the Chrome address bar, but not the navigation bar at the bottom. (They do however hide it in some other browsers, like Opera.) I've tested this on Xiaomi mi A2 and Galaxy S8.

There must be a way to achieve this (at least it certainly is for a video element), because fullscreen mode on both YouTube and PornHub are able to hide this menu entirely.

like image 815
Rok Novak Avatar asked Jan 25 '19 21:01

Rok Novak


People also ask

How do I hide the navigation button in Chrome?

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.

How do I hide navigation bar on Android?

Way 1: Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.

How do I hide the buttons at the bottom of my screen?

If you want to hide the navigation bar, just follow these steps: 1 Open your “Settings” and tap “Display”. 2 Scroll down to the “Navigation bar” option and tap on it. 3 Here you can choose between “Buttons” and “Swipe gestures”.

How do I hide the navigation bar without a computer?

Hide Navigation Bar Using Third Party AppsGo to the Play Store and download Power Toggles from here. It's free and it works with non-rooted devices. Then, long press on the home screen and go to the “Widgets” section, and select “Power Toggles”, and drag the “4×1 Panel Widget” to the desktop.


2 Answers

Use a webmanifest. Put this inside a file:

{
   "display": "fullscreen"
}

Then add in the head of your HTML:

<link rel="manifest" href="/manifest.webmanifest">

Check this link for all possible methods: https://developer.mozilla.org/en-US/docs/Web/Manifest

like image 137
Anon777 Avatar answered Sep 30 '22 11:09

Anon777


Bit late to the party, but hopefully it still helps.

The requestFullscreen() method of the Fullscreen API accepts an optional options object.

document.documentElement.requestFullscreen({ navigationUI: 'hide' });

This should do the trick.

like image 45
kdani Avatar answered Sep 30 '22 10:09

kdani