mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
4.72k stars 938 forks source link

Secure Context Error #375

Open MG-ng opened 2 years ago

MG-ng commented 2 years ago

Hey, cool, that you have thought about unsecure connections.

However I would like to use this JavaScript also on a .onion site and in a local network, where the domain ending is .local Please add these cases to the secure connections.

Thank you very much in advance.

https://github.com/mebjas/html5-qrcode/blob/f03db4dc51d7bd4d43a63d9ef8d863201b8abef7/src/strings.ts#L41

mebjas commented 2 years ago

This is actually not restricted by the library but by browsers which do not allow camera access from unsecured connections. (i.e. camera access is supported on https / localhost setups only).