uniapp 判断在特定app或h5里还需要判断当前环境

var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('html5plus') > -1) {//APP环境
}
if (ua.indexOf('html5plus') === -1) {//webview环境
}
if (('standalone' in window.navigator) && window.navigator.standalone) { //浏览器添加到桌面打开的环境
}


posted @ 2025-10-14 10:58  light丶  阅读(6)  评论(0)    收藏  举报