fix: wrong OS judgment (#1525)

This commit is contained in:
JimmFly 2023-03-11 02:06:40 +08:00 committed by GitHub
parent 1239957446
commit 21bfec3402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@ export function getUaHelper() {
(uas.indexOf('android') > -1 || uas.indexOf('linux') > -1)) ||
uas.indexOf('adr') > -1;
const ios = mobile && !android && /Mac OS/i.test(ua);
const mac = !mobile && /Mac OS/i.test(ua);
const iphone = ios && uas.indexOf('iphone') > -1;
const ipad = ios && !iphone;
const wx = /MicroMessenger/i.test(ua);
@ -33,6 +34,7 @@ export function getUaHelper() {
mobile,
android,
ios,
mac,
wx,
chrome,
iphone,
@ -73,7 +75,7 @@ export function getUaHelper() {
private initUaFlags() {
this.isLinux = this.checkUseragent('linux');
this.isMacOs = this.checkUseragent('ios');
this.isMacOs = this.checkUseragent('mac');
this.isSafari = this.checkUseragent('safari');
this.isWindows = this.checkUseragent('win');
this.isFireFox = this.checkUseragent('firefox');