-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何识别设备类型,Phone, Tablet(Pad) 和 Desktop ? #42
Comments
可以增加苹果系列的区分,3、4、5、6可以通过屏幕高度window.screen.height辅助window.devicePixelRatio来判断。比如: var iosVersioin;
if (detector.device.name == "iphone") {
var height = screen.height;
if (height == 480) {
iosVersioin = "4、4s"
} else {
if (height == 568) {
iosVersioin = "5、5s、5c"
} else {
if (height == 667) {
if(window.devicePixelRatio == 3){
iosVersioin = '6 plus';
}else{
iosVersioin = "6"
}
} else {
if (height == 736) {
iosVersioin = "6 plus"
} else {
iosVersioin = "unkown"
}
}
}
}
} |
希望增加iPhone 4,5,6的检测 |
什么用途? |
记录,用户反馈问题时可以知道是哪个型号的问题。日常error也可以快速找测试机来检查。 |
一般跟硬件关系不大吧,主要看操作系统、浏览器及渲染引擎的软件。 |
不是大家都需要这个,那我们就自己实现一下就好了。 |
嗯。还没想清楚,detector 暂时还没有加入这个功能的计划。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考
The text was updated successfully, but these errors were encountered: