These past two days I made a little QR-code recognizer using navigator.mediaDevices.getDisplayMedia() and jsQR.js. The basic idea is to use the navigator.mediaDevices.getDisplayMedia() method to invoke the browser’s screen-sharing feature to capture a page from some website or app, draw it onto a canvas, and then call jsQR.js
to parse any QR codes in that page. Because the screen-sharing feature has an option to capture the entire screen, in theory it can recognize QR codes anywhere, but limited by resolution, some smaller codes won’t be detected.
Apart from IE, all modern desktop browsers support navigator.mediaDevices.getDisplayMedia(); on mobile, no browser currently supports this method.