首页 > 技术文章 > JS如何判断是不是iphoneX

theWayToAce 2017-12-01 16:51 原文

function isIphoneX(){
    return /iphone/gi.test(navigator.userAgent) && (screen.height == 812 && screen.width == 375)
}

 

推荐阅读