检测设备品牌 [英] Detecting device brand

查看:84
本文介绍了检测设备品牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事网络分析。我正在使用JavaScript客户端和NodeJS服务器端。我知道我们可以使用<$ c查找设备类型。 $ c> userAgent ,但是如何检测设备品牌(客户端或服务器端)?

I am working on web analytics. I am using JavaScript client-side and NodeJS server-side. I know we can find out device type using userAgent, but how do I detect the device brand (client or server side)?

推荐答案

你不能直接做; userAgent字段仅不包含供应商。但是,您可以建立映射到特定供应商的userAgent令牌库。不过,这将涉及对各种设备的大量研究和测试。

You can't do it directly; the userAgent field simply does not contain the vendor. However you can build up a library of userAgent tokens which map to particular vendors. This will involve a lot of research and testing on a wide range of devices, though.

例如,任何带有 iOS, iPhone或 iPad的内容您可以将userAgent安全地映射到 Apple。
然后,例如,三星Galaxy S3在userAgent中具有型号,即 GT-I9300。然后,您可以将其映射到三星。
...然后您需要对要识别的其他所有设备重复此操作。在线查找用户代理字符串可能是最快的方法。

For example, anything with "iOS", "iPhone" or "iPad" in the userAgent you can safely map to "Apple". Then the Samsung Galaxy S3, for example, has the model number in the userAgent, which is "GT-I9300". You can then map this to "Samsung". ...and then you'd need to repeat this for every other device you want to recognise. Looking up user agent strings online is probably the quickest way.

这篇关于检测设备品牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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