Skip to content

zhu181/QrcodeScanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QrcodeScanner — Chrome extension

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 BarcodeDetector API for best performance. If unavailable, it will use a jsQR fallback.

Installation (load unpacked in Developer mode):

  1. Open Chrome -> Extensions (chrome://extensions/).
  2. Enable "Developer mode" in the top-right.
  3. Click "Load unpacked" and select this project folder QrcodeScanner.

Local jsQR fallback

  • The extension will try to load a local copy of jsQR from vendors/jsQR.js when BarcodeDetector is unavailable. This avoids CDN/CSP issues on restrictive pages.
  • To install a local copy of jsQR:
    1. Download the minified bundle: https://unpkg.com/jsqr/dist/jsQR.js
    2. Save it as vendors/jsQR.js inside this project folder.

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 jsQR directly into the extension to fully avoid CDN/CSP issues (I can add this).
  • Add continuous/real-time scanning or camera capture UI.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors