if ( ("standalone" in window.navigator) && !window.navigator.standalone ){ // .... code here .... }