mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 12:34:22 +08:00
修复 macOS 被误判为 iOS 导致窗口缩到左上角与圆角失效
This commit is contained in:
+3
-5
@@ -490,9 +490,8 @@ function getArchitecture(): string {
|
||||
|
||||
function getPlatform(): string {
|
||||
const userAgent = navigator.userAgent.toLowerCase()
|
||||
const isAppleTouchDevice = userAgent.includes("macintosh") && navigator.maxTouchPoints > 1
|
||||
|
||||
if (userAgent.includes("iphone") || userAgent.includes("ipad") || userAgent.includes("ipod") || isAppleTouchDevice) {
|
||||
if (userAgent.includes("iphone") || userAgent.includes("ipad") || userAgent.includes("ipod")) {
|
||||
return "iOS"
|
||||
} else if (userAgent.includes("android")) {
|
||||
return "Android"
|
||||
@@ -511,9 +510,8 @@ function getPlatform(): string {
|
||||
|
||||
function getIosDeviceInfo(): { isIosDevice: boolean; isIosPhone: boolean } {
|
||||
const userAgent = navigator.userAgent.toLowerCase()
|
||||
const isAppleTouchDevice = userAgent.includes("macintosh") && navigator.maxTouchPoints > 1
|
||||
const isIosDevice = /iphone|ipad|ipod/.test(userAgent) || isAppleTouchDevice
|
||||
const isIosTablet = userAgent.includes("ipad") || isAppleTouchDevice
|
||||
const isIosDevice = /iphone|ipad|ipod/.test(userAgent)
|
||||
const isIosTablet = userAgent.includes("ipad")
|
||||
return {
|
||||
isIosDevice,
|
||||
isIosPhone: isIosDevice && !isIosTablet,
|
||||
|
||||
+1
-2
@@ -127,8 +127,7 @@ const disableTouchZoom = () => {
|
||||
disableTouchZoom()
|
||||
|
||||
const platform = navigator.userAgent.toLowerCase()
|
||||
const isAppleTouchDevice = platform.includes("macintosh") && navigator.maxTouchPoints > 1
|
||||
const isIos = /iphone|ipad|ipod/.test(platform) || isAppleTouchDevice
|
||||
const isIos = /iphone|ipad|ipod/.test(platform)
|
||||
const isAndroid = platform.includes("android")
|
||||
const isMacDesktop = platform.includes("mac") && !isIos
|
||||
|
||||
|
||||
Reference in New Issue
Block a user