Closed MelbourneDeveloper closed 5 years ago
WebAssembly programs execute in a sandbox in the browser and cannot directly access the system. However, someone might be able to make a backend for this library that calls some Javascript code which in turn calls the WebUSB API provided by Google Chrome. I don't know any other way that you would be able to access USB devices from WebAssembly.
If you haven't already, you should consider just using that API directly from Javascript.
@DavidEGrayson thanks. Yep. My understanding of wasm was a little different but now I understand that it's got the same sandboxing as JavaScript.
Please port to wasm so we can get USB support in browsers.
Here is a tool to do it: https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm