简体   繁体   中英

Detect if a USB device is plugged in Javascript from browser

是否有基于 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.

But there are some exceptions :

Your javascript code is sand boxed and therefore cannot access system resources such as usb devices.

I think the only way to access the USB devices would be to write a browser plugin. How to get USB devices List from Browser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM