简体   繁体   English

如何通过JavaScript检测性能低下的手机?

[英]How to detect low performance mobile via javascript?

While users open my website, I want to turn off some animation effects if the current performance of the user's device is low. 用户打开我的网站时,如果用户设备的当前性能较低,我想关闭一些动画效果。

What's the best practise to ranking the device's performance? 评估设备性能的最佳实践是什么? For example there are 10 ranks, for the devices below rank 5, I will use different way to show some effects. 例如,有10个等级,对于等级5以下的设备,我将使用不同的方式来显示一些效果。

There is no way around a device database with precompiled benchmark metrics for general mobile browser users. 对于普通的移动浏览器用户而言,没有一种具有预编译基准度量标准的设备数据库。 I am not aware of such a database, since most of them have capabilities and not performance in mind. 我不知道这样的数据库,因为它们大多数都具有功能而不是性能。

However, if you want to package it in a WebView container, you could probably run the benchmark yourself in a separate hidden WebView when the user isn't doing anything. 但是,如果要将其打包在WebView容器中,则在用户不执行任何操作时,可以自己在单独的隐藏WebView中运行基准测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM