Javascript chrome.hid.getDevices()类型错误

Javascript chrome.hid.getDevices()类型错误,javascript,google-chrome,hid,Javascript,Google Chrome,Hid,我使用此“”时发生以下错误 未捕获的TypeError:无法读取未定义的属性“getDevices” at设备(control panel.js:55) 在初始化窗口(controlpanel.js:42) chrome版本是新发行的吗?如何修改它以使用新的chrome var enumerateDevices = function() { chrome.hid.getDevices({}, onDevicesEnumerated); chrome.hid.onDeviceAdd

我使用此“”时发生以下错误

未捕获的TypeError:无法读取未定义的属性“getDevices” at设备(control panel.js:55) 在初始化窗口(controlpanel.js:42)

chrome版本是新发行的吗?如何修改它以使用新的chrome

var enumerateDevices = function() {
    chrome.hid.getDevices({}, onDevicesEnumerated);
    chrome.hid.onDeviceAdded.addListener(onDeviceAdded);
    chrome.hid.onDeviceRemoved.addListener(onDeviceRemoved);
  };

谢谢你的编辑。您确实将此repo安装为浏览器扩展,对吗?抱歉,我不太了解此语言。如何将此repo安装为浏览器扩展?最简单的方法可能是使用chrome webstore的链接:使用此链接,我的计算机无法捕获任何设备。您看到了其中的说明“请注意,为了使用此示例,您需要使用与所选硬件相对应的一个或多个VID/PID对更新manifest.json中的usbDevices列表。“谢谢你的编辑。您确实将此repo安装为浏览器扩展,对吗?抱歉,我不太了解此语言。如何将此repo安装为浏览器扩展?最简单的方法可能是使用chrome webstore的链接:使用此链接,我的计算机无法捕获任何设备。您看到了其中的说明请注意,为了使用此示例,您需要使用与所选硬件相对应的一个或多个VID/PID对更新manifest.json中的usbDevices列表