user1365106
user1365106

Reputation: 21

how to detect that web app is running in app mode or in safari mode

How to check that a web page is running in safari mode with address bar or in app mode without address bar in iPad

             <script>
              if (window.navigator.standalone) {

                  <link type="text/css" href="ipad.css" rel="stylesheet" />



              }


              els{

                  <link type="text/css" href="safari.css" rel="stylesheet" />

              }

              </script>

Upvotes: 2

Views: 1833

Answers (1)

Ed Kirk
Ed Kirk

Reputation: 583

By in app mode I assume you mean when it's launched from the home screen:

if (window.navigator.standalone) {

    /* Launched from home screen code */

}

This works on all iOS devices ASAIK.

Upvotes: 3

Related Questions