Static GitHub Pages application for scanning barcodes with a live camera, images, PDFs, clipboard paste, drag and drop, and public URLs, plus difficult QR code recovery.
cd /Users/lsr/Documents/manuals.plus
ln -s barcode-scanner.github.io barcode-scanner
python3 -m http.server 4173Open http://127.0.0.1:4173/barcode-scanner/. The /barcode-scanner/ base path matches the GitHub project Pages deployment. Remove the local symlink after testing if it is no longer needed.
node --check assets/js/barcode-scanner.js
node --check assets/js/pwa.js
node --check service-worker.js
node tests/site-check.mjsRemote inputs are requested directly with CORS and no credentials. If that fails, the browser tries cors.eu.org, AllOrigins, and corsproxy.io, in that order. Local uploads, paste, and drag-and-drop never use these services.
The live scanner prefers a rear-facing camera, enumerates camera devices after permission is granted, and exposes torch and zoom controls when the selected device supports them. Bounded-resolution frames are sampled locally and passed to a background ZXing-C++ AllReadable worker so decoding does not block camera controls. When ZXing returns no payload, the worker periodically tries the pinned AnyDCode WebAssembly decoder as a later fallback. Tracks and the worker are stopped when the user stops scanning, switches input modes, hides the page, or leaves the site.
The camera interaction was independently implemented with georapbox/barcode-scanner as a feature reference. Its source is MIT-licensed; no source from that project is bundled here.
The scoped service worker precaches the application shell, camera worker, ZXing and AnyDCode decoders, QR fallbacks, and PDF.js core. Installed launches use /barcode-scanner/?mode=camera#scanner, while capable browsers can also expose camera/file shortcuts, accept shared public URLs, and hand supported image or PDF files to the app. Optional converters, OCR language data, PDF character maps, and other large recovery assets are cached at runtime after first use.
Updates do not call skipWaiting automatically. A waiting service worker presents an in-app update control so an active camera or file scan is never reloaded without the user choosing to update.
The canonical target is https://lrehmann.github.io/barcode-scanner/. GitHub Pages publishes from the root of the main branch in lrehmann/barcode-scanner.