检测USB设备是否从浏览器插入Javascript [英] Detect if a USB device is plugged in Javascript from browser

查看:138
本文介绍了检测USB设备是否从浏览器插入Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有基于Javascript的机制,我可以通过浏览器检测到用户是否插入了特定的USB设备?

Is there Javascript based mechanism with which i can detect, through a browser, that a user has a specific usb device plugged in?

推荐答案

出于安全原因,Web浏览器中的JavaScript仅提供对计算机资源的限制访问权限。将文件存储在任意文件夹中,启动应用程序或与 USB 设备通信

For security reasons, JavaScript in web browsers provides only restricted access to computer resources. It is not possible to store files in an arbitrary folder, start applications or communicate with a USB device.

但也有一些例外:

  • In legacy browsers cuch as IE6 ~ IE8 you can use ActiveX objects or Java applets to achieve this .
  • Use a chrome.usb API .
  • Write a browser plugin using NPAPI , (it is not here for long though)

这篇关于检测USB设备是否从浏览器插入Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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