有没有办法知道访问网页“平台”的硬件资源什么? [英] Is there a way to know anything about hardware resources of 'platform' accessing webpage?

查看:171
本文介绍了有没有办法知道访问网页“平台”的硬件资源什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够了解从网页浏览器的硬件资源,或者至少是一个粗略的估计。

I'd like to be able to find out about a browser's hardware resources from a web page, or at least a rough estimation.

甚至当你发现现代技术的presence(如 csstransforms3d csstransitions requestAnimationFrame )的通过像 Modernizr的的工具,您不能确定是否启动一些性能消耗选项浏览器(如花哨的3D动画)或避免它。

Even when you detect the presence of modern technology (such as csstransforms3d, csstransitions, requestAnimationFrame) in a browser via a tool like Modernizr, you cannot be sure whether to activate some performance-consuming option (such as fancy 3D animation) or to avoid it.

我问,因为我有(很多)经验的情况下,浏览器的是现代(最新的Chrome或Firefox支持所有很酷的技术),但操作系统的CPU ,GPU和可用内存仅仅是灾难性的(32位的Windows XP集成GPU),从而检测到的浏览器完全基于决策帽也是白搭。

I'm asking because I have (a lot of) experience with situations where the browser is modern (latest Chrome or Firefox supporting all cool technologies) but OS's CPU, GPU, and available memory are just catastrophic (32bit Windows XP with integrated GPU) and thus a decision based purely on detected browser caps is no good.

推荐答案

在一般情况下,对用户的系统可用(以网页)的信息是非常有限的。

In general, the available (to web pages) information about the user's system is very limited.

我记得加入一个这样的API来进行讨论网络平台 navigator.hardwareConcurrency - 可用的内核数),其中特征的反对者提出的理由反对它,特别是:

I remember a discussion of adding one such API to the web platform (navigator.hardwareConcurrency - the number of available cores), where the opponents of the feature explained the reasons against it, in particular:


  • 提供给您的应用程序内核的数量取决于其它工作量,不只是在可用的硬件。这不是恒定的,用户可能不愿意让你的应用程序中使用(你选择或任何固定部分)中的所有可用的硬件资源;

  • 指纹识别客户端。

  • 太化今天的具体情况。网络被设计为在许多设备上,其中一些目前甚至不存在不正常工作。

这些参数的工作以及其他的API,用于查询特定的硬件资源。的明确你想什么检查,看看如果用户的系统能够承受运​​行花哨的3D动画?

These arguments work as well for other APIs for querying the specific hardware resources. What specifically would you like to check to see if the user's system can afford running a "fancy 3D animation"?

由于我宁愿你不使用额外的资源(如花哨的3D动画),如果它没有必要为您的网站/应用的核心功能的用户。这是可悲真的,我必须购买一个新的笔记本电脑每隔几年只是为了能够继续我当前的工作流,而不由于缺乏硬件资源的运行速度非常慢。

As a user I'd rather you didn't use additional resources (such as fancy 3D animation) if it's not necessary for the core function of your site/app. It's sad really that I have to buy a new laptop every few years just to be able to continue with my current workflow without running very slowly due to lack of HW resources.

这是说,这里就是你的可以的事:

That said, here's what you can do:


  • 提供备用链接谁正与该网站的完整版麻烦的用户。

    • 如果这对你那么重要,你可以先运行短基准来检查的性能和回退到网站的资源少饥渴版本,如果您怀疑系统缺少资源。

    • This article mentions this method on mobile: http://blog.scottlogic.com/2014/12/12/html5-android-optimisation.html

    这篇关于有没有办法知道访问网页“平台”的硬件资源什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆