Some code samples please

%3CLINGO-SUB%20id%3D%22lingo-sub-1960532%22%20slang%3D%22en-US%22%3ESome%20code%20samples%20please%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1960532%22%20slang%3D%22en-US%22%3E%3CP%3EI%20see%20from%20the%20Edge%20security%20%2F%20permissions%20screen%20that%20it%20supports%20WebUSB%20and%20serial%20port%20access%2C%20however%20I%20cant%20find%20any%20code%20samples.%20Looking%20around%20the%20interweb%2C%20the%20javascript%20folk%20say%20its%20not%20possible%20due%20to%20sandboxes%20etc%2C%20which%20probably%20was%20true%2010%20years%20ago.%20More%20interweb%20info%20rot.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETIA%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1960557%22%20slang%3D%22en-US%22%3ERe%3A%20Some%20code%20samples%20please%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1960557%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3EThis%20article%20explains%20how%20to%20build%20a%20device%20to%20take%20full%20advantage%20of%20the%20WebUSB%20API.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fweb.dev%2Fbuild-for-webusb%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fweb.dev%2Fbuild-for-webusb%2F%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EAccess%20USB%20Devices%20on%20the%20Web%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fweb.dev%2Fusb%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fweb.dev%2Fusb%2F%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EProgram%20a%20smart%20device%20directly%2C%20no%20install%20needed%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fmedium.com%2F%40kennethrohde%2Fprogram-a-smart-device-directly-no-install-needed-cd8b29320d76%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmedium.com%2F%40kennethrohde%2Fprogram-a-smart-device-directly-no-install-needed-cd8b29320d76%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3Ehope%20that%20helps%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Contributor

I see from the Edge security / permissions screen that it supports WebUSB and serial port access, however I cant find any code samples. Looking around the interweb, the javascript folk say its not possible due to sandboxes etc, which probably was true 10 years ago. More interweb info rot.

 

TIA

1 Reply

Hi,
This article explains how to build a device to take full advantage of the WebUSB API.

https://web.dev/build-for-webusb/

Access USB Devices on the Web
https://web.dev/usb/

Program a smart device directly, no install needed
https://medium.com/@kennethrohde/program-a-smart-device-directly-no-install-needed-cd8b29320d76

 

https://github.com/WICG/webusb


hope that helps