QR Code scanner using HTML and Javascript

Minhaz
7 min readFeb 29, 2020

In 2015 I had written an HTML5 based QR code scanning library as a jQuery extension. Recently I realised there was some consistent traffic on my Github Project and the demo page. As I dug more into what was going on and I was embarrassed to see the poor design and obsolete support to the latest HTML APIs around Camera. I recently fixed some of the issues and refactored the javascript library that is now independent of jQuery library and supports Promise based APIs. In this article I’ll explain how to use the new version of the library, some changes and reasons for them and existing issues and plan to fix them.

Important Edit 1 (14th June 2021)

Update: Version 2.x.x can scan different types of codes including bar codes, aztec codes and different 1D codes along with QR Codes.

Lot of things have changed since v1.0.1 and latest release for the library is v2.0.9 - Please visit QR and barcode scanner using HTML and Javascript for latest content.

If you are interested in a web based QR Code or barcode scanner try out: scanapp.org (it’s the perfect demo of this project).

Continue reading article on v1.0.1

To callout loud, the major changes are:

  • Removed jQuery dependency
  • Refactored the APIs to return Promise rather than being purely based on callbacks.

--

--

Minhaz

Staff Software Engineer @Google. Leading teams democratising On device AI for for masses. Writes about programming generics & specifics.