UA判断环境,可以判断是否在App内.
App默认自带的UA值(User Agent)为bsl
javascript例:
<script> var ua = navigator.userAgent; if(ua.indexOf("bsl") >= 0 ) {alert('App内');} else {alert('App外');} </script>
自定义UA值
网页生成app支持自定义UA(User Agent)配置
App默认自带的UA值(User Agent)为bsl
javascript例:
<script> var ua = navigator.userAgent; if(ua.indexOf("bsl") >= 0 ) {alert('App内');} else {alert('App外');} </script>
自定义UA值
网页生成app支持自定义UA(User Agent)配置