企业级代码,直接用吧
// qq浏览器检测
isQQBrowser: function() {
// 是则返回版本号,否则返回false
let match = window.navigator.userAgent.match(
/MicroMessenger\/([0-9.]*)/
);
return match && match[1];
},
// 是否全面屏
isFullScreen: function() {
let isFull = false;
const rate = window.screen.height / window.screen.width;
let limit =
window.screen.height == window.screen.availHeight ? 1.8 : 1.65; // 临界判断值
// window.screen.height为屏幕高度
// window.screen.availHeight 为浏览器 可用高度
if (rate > limit) {
isFull = true;
}
return isFull;
},