使用 JQuery 或 Javascript 获取设备 ID

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16544916/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 05:05:20  来源:igfitidea点击:

Getting Device ID using JQuery or Javascript

javascriptjqueryweb-applicationssignalrhybrid-mobile-app

提问by Salman

Is there a way to get the device's unique id using JQuery/JavaScript.

有没有办法使用 JQuery/JavaScript 获取设备的唯一 ID。

I know one can detect the user agent and type of device that is being used but that is not required. I need to know the unique id that is being used.

我知道可以检测正在使用的用户代理和设备类型,但这不是必需的。我需要知道正在使用的唯一 ID。

Having said that I also know that browser is the least priviliged application running on the machine and it should be able to get that id.

话虽如此,我也知道浏览器是机器上运行的特权最低的应用程序,它应该能够获得该 ID。

But still asking if there is a way?

但是还是问有没有办法?

采纳答案by Gurpreet Singh

Not possible as far as I know.

据我所知不可能。

I believe it's a security issue. Your device ID is very sensitive information that you wouldn't want just any website being able to capture.

我相信这是一个安全问题。您的设备 ID 是非常敏感的信息,您不希望任何网站都能捕获这些信息。

Update:

更新:

It's not possible (without any hackery at least) to physically distinguish the computers accessing a web site without the permission of their owners. You can store a cookie to identify the machine when it visits your site again but the key is that the user is in control, and rightly so.

在未经所有者许可的情况下,不可能(至少在没有任何黑客技术的情况下)从物理上区分访问网站的计算机。您可以存储一个 cookie 以在机器再次访问您的网站时对其进行识别,但关键是用户处于控制之中,这是正确的。