The Safari browser on iOS enables the web application to be displayed in full screen to achieve a display effect similar to that of a local application. However, this requires you to add the web application icon to the home screen. As a developer, we may want our web application to prompt users to add the web application icon to the home screen when it is running in a non-full screen state for better display.
To check whether the web application is currently running in full screen mode, you only need to check the window. navigator. whether standalone is true or not. If this attribute is true, the Web application is currently running in full screen state; otherwise, the Web application is running in non-full screen state. When detecting that the Web application is running in a non-full screen state, you can be prompted to add the web application icon to the home screen.
Running effect: