Webconfig commit

This commit is contained in:
William Toohey
2017-03-04 15:45:36 +10:00
parent 4dbdffc337
commit 1cd98d7a91
6 changed files with 482 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
(function(window, document, navigator) {
"use strict";
var UsbWrapper = new function() {
this.hasUSB = navigator && navigator.usb;
// returns a promise
this.connect = (vid, pid) => {
return navigator.usb.requestDevice({ filters: [
{ vendorId: vid, productId: pid }] })
.catch(error => {
console.log(error);
return null;
});
};
};
window.UsbWrapper = UsbWrapper;
})(window, document, navigator);