Is there a way to communicate with USB devices from browser?

前端 未结 6 1982
孤独总比滥情好
孤独总比滥情好 2021-02-14 23:45

Is there a way to communicate with USB devices within regular browser (FF, Safari, IE8, etc)? I assume it could be Javascript -> Java bridge or something else.

Please a

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-15 00:05

    If your CC and barcode scanners work as HID devices (basically, keyboard emulation), yes you can, and I have seen it done. If they're more complicated than that, it depends, the system is going to require drivers for the device and it is then OS dependant. But, for example, there are smartcard readers that will hook the card into the system's certificate framework for authentication.

    You're not going to be able to use a chipped credit card with that sort of reader, however, since the protocol for those requires bidirectional communication with the card. I think there may be a way to talk to a proper point of sale CC terminal over USB, but that will most likely require drivers.

提交回复
热议问题