【发布时间】:2017-01-26 15:24:08
【问题描述】:
在 Windows 10 PRO 版本 1511(操作系统内部版本 10586.753)上运行 Chrome 56.0.2924.76(64 位)。已在 chrome 上启用了 Experimental-web-platform-features,使用标志 --disable-webusb-security 并以管理员身份运行它。我尝试使用 getDevices 在 localhost(使用 https)上获取 USB 设备列表,但我得到空列表,尽管 chrome://device-log 向我显示了很多设备。可能是什么问题?
navigator.usb.getDevices().then(function(devices){
console.log(devices);
});
// console outputs []
【问题讨论】:
标签: javascript google-chrome webusb