I was looking for possibility to create QR code reader in my HTML5 based web page. I've done some googling and all the links point me to the mobile applications.
Please help me with some pointers as to how I can use HTML5 and JavaScript to read a QR code containing a url and then redirect the browser to that URL.
You can't ensure that the URL came from scanning the QR code, that isn't possible. QR codes are just a method of encoding text, once the user knows the text they can do whatever they want with it. You can, however, restrict the usefulness of the QR code so even if it is leaked it isn't useful.
How to use the QR code reader. Tap the search bar. Above the keyboard, tap the Scan icon. After scanning you will see the web address, tap Allow to visit the site.
There aren't many JavaScript decoders.
There is one at http://www.webqr.com/index.html
The easiest way is to run ZXing or similar on your server. You can then POST the image and get the decoded result back in the response.
The jsqrcode library by Lazarsoft is now working perfectly using just HTML5, i.e. getUserMedia
(WebRTC). You can find it on GitHub.
I also found a great fork which is much simplified. Just one file (plus jQuery) and one call of a method: see html5-qrcode on GitHub.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With