JavaScript for scanning QR codes in browsers and on mobile devices