Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if page added To iPhone homescreen

Is it possible to check using JavaScript or CSS if a page has been added to the iPhone homescreen in webapp mode. Like getting the height of the screen which wouldn't have the nav bar so would be 460px

like image 433
Jonathan. Avatar asked Jan 28 '11 16:01

Jonathan.


People also ask

How do you see active screens on iPhone?

To see all your open apps in the App Switcher, do one of the following: On an iPhone with Face ID: Swipe up from the bottom of the screen, then pause in the center of the screen. On an iPhone with a Home button: Double-click the Home button.


1 Answers

You're looking for window.navigator.standalone (mentioned by Apple here)

This won't tell you if the page has been added to the homescreen if it is being visited in the regular browser, but it will tell you if it has been launched from the homescreen.

like image 141
Quentin Avatar answered Oct 11 '22 17:10

Quentin