QrcodeScanner is a lightweight Chrome extension that detects QR codes from images on web pages.
How it works
- Right-click any image on a page and choose Scan QR code in image. The extension downloads the image, draws it to a canvas and attempts to decode a QR code.
- It prefers the browser's
BarcodeDetectorAPI for best performance. If unavailable, it will use ajsQRfallback.
Installation (load unpacked in Developer mode):
- Open Chrome -> Extensions (chrome://extensions/).
- Enable "Developer mode" in the top-right.
- Click "Load unpacked" and select this project folder
QrcodeScanner.
Local jsQR fallback
- The extension will try to load a local copy of
jsQRfromvendors/jsQR.jswhenBarcodeDetectoris unavailable. This avoids CDN/CSP issues on restrictive pages. - To install a local copy of jsQR:
- Download the minified bundle:
https://unpkg.com/jsqr/dist/jsQR.js - Save it as
vendors/jsQR.jsinside this project folder.
- Download the minified bundle:
If the local file is missing, the extension attempts to load jsQR from a CDN as a fallback. Note: some pages' Content Security Policy (CSP) may prevent loading external scripts, so the local copy is recommended.
Limitations and notes
- Cross-origin images can be blocked by CORS and prevent the canvas from being read. If you see an error about CORS, try opening the image in a new tab or saving it locally and scanning that file.
- Detection quality depends on the image resolution and QR clarity.
Possible improvements
- Bundle
jsQRdirectly into the extension to fully avoid CDN/CSP issues (I can add this). - Add continuous/real-time scanning or camera capture UI.