是否有可能?使用浏览器获取设备信息. [英] Is it possible? To get information of a device using a browser.

查看:870
本文介绍了是否有可能?使用浏览器获取设备信息.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道浏览器是否有可能使用Web应用程序并查找设备信息,例如IMEI或UUID.如果是,请给我一些指导.

谢谢

我尝试过的事情:

我试图在网上搜索,但找不到我想要的确切信息.但是,我只是获得当前设备分辨率的信息.

I wanna know is it possible for the browser to use web application and find device information e.g. IMEI or UUID. If yes then kindly give me some direction.

Thanks

What I have tried:

I have tried to search on web but not find the exact information that I want. But instead of this I just get information of current device resolution.

推荐答案

否,浏览器不允许您的Web应用程序确定基于设备的功能. Web浏览器仅提供有关浏览器本身的详细信息.可以找到其他一些属性,例如使用的操作系统,使用IP地址等的位置等.

其他特定于设备的特征始终对Web应用程序隐藏.除非用户允许,否则浏览器甚至不允许您的Web应用程序与脱机应用程序和协议进行通信,或者已经存在可以处理协议请求的应用程序.例如, BitTorrent磁链如何工作? -堆栈溢出?

您剩下两个选择.

1)忘记执行任务的这种方式.这行不通.如果您仍要强制执行,则在线服务可能会将您的Web应用程序定位为恶意软件应用程序.
2)尝试获取可以在移动设备上执行的脱机服务.然后从该服务本身获取特定于设备的特征.还有另一种方法.您可以使用本机Android应用程序为您的客户端分发.在该应用程序中使用WebView控件加载网站.但是,这样做时,您可以在后台访问设备属性并将其通过URL本身发送到Web应用程序,例如http://www.example.com/default.aspx?data=value&data2= value2

在WebView中构建Web应用程序| Android开发人员 [ ^ ]
如何获取设备的IMEI/ESN以编程方式在Android中? -堆栈溢出 [ ^ ]

请记住,即使使用此方法,您的Android应用程序也需要获得查询设备属性和敏感数据的权限.例如,读取电话"状态将要求您显式获得READ_PHONE_STATE的权限.
No, browsers do not allow your web application to determine the device-based capabilities. Web browser just provides the details about the, well, browser itself. A few other properties can be found, such as operating system being used, location etc. using the IP address etc.

Other device-specific characteristics are always hidden from the web application. Browsers don''t even allow your web applications to communicate with offline applications and protocols unless user allows it to, or there is already an application that can handle the protocol request. For example, How do BitTorrent magnet links work? - Stack Overflow?

You are left with two options.

1) Forget about this way of performing the task. This won''t work. If you still want to enforce it, online services may target your web application as a malware application.
2) Try to get an offline service that can be executed on the mobile device. Then get the device-specific traits from that service itself. There is another way of doing this. You can use the native Android application to be distributed for your clients. Use a WebView control in that application to load the web site. However, while you do, on the background you can access the device properties and send them to the web application in the URL itself, such as, http://www.example.com/default.aspx?data=value&data2=value2

Building Web Apps in WebView | Android Developers[^]
How to get the device's IMEI/ESN programmatically in android? - Stack Overflow[^]

Remember, even this method would require your Android application to get permissions to query device properties and sensitive data. For example, reading the Phone state would require you to explicitly get the permission for READ_PHONE_STATE.


这篇关于是否有可能?使用浏览器获取设备信息.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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