design icon indicating copy to clipboard operation
design copied to clipboard

Question about hardware limitations

Open Arcalise08 opened this issue 4 years ago • 2 comments

So just gonna start off saying I haven't used much web assembly.I heard about it several months back when blazor went production ready.

So my current use case is I'm needing to access some native drivers for a label printer & nfc reader. We are attempting to retarget a corporate desktop project written in VB to a react or blazor webapp. The issue is, the label printer interface is written in .net 4.7. Our current fix for this is a desktop webserver that listens to signalr and relays native commands however that isn't the best experience

It's unclear to me if this is something webassembly can solve. As a web developer it seems unlikely as I can see the security risks in allowing such things. However I am seeing people say it can reference some native dlls so I'm not sure.

Arcalise08 avatar Jul 19 '21 02:07 Arcalise08

The only resources a WebAssembly module can access are those provided to it explicitly via imports. So, Wasm modules cannot reference 'native dlls' unless they are also accessible to JavaScript (in the browser that is). If your webapp can access the label printer, then your Blazor webapp will also be able to. Hope that this helps to clarify your questions.

fgmccabe avatar Jul 19 '21 15:07 fgmccabe

Yes, That is exactly what I thought.

I did wonder if native devices could be granted access to by the sandboxed browser. It looks like webHID does allow for this.

Arcalise08 avatar Jul 19 '21 15:07 Arcalise08

It appears the question here is answered; if there are any future questions, please file new issues!

sunfishcode avatar Oct 29 '22 00:10 sunfishcode