BarcodeDetector is missing in Safari and Firefox
The W3C Shape Detection BarcodeDetector API is unavailable in Safari (iOS, iPadOS and macOS), Chrome on iOS (WebKit), Firefox and many Windows desktop Chromium builds.
Dropping in the MIT barcode-detector ponyfill backed by zxing-wasm restores cross-browser support in minutes, though classical thresholding still drops codes under motion blur, glare, curved labels and dense multi-code pallets.
Facts read on 26 November 2026. Sources are at the foot of the page.
Why it happens
| Browser / OS | Native BarcodeDetector status (Nov 2026) |
|---|---|
| Safari (iOS, iPadOS, macOS) | Not supported. Apple restricts its Vision / CIDetector barcode scanner to native apps (VisionKit). |
| Chrome on iOS | Not supported, because iOS browsers run on WebKit. |
| Firefox (Desktop and Android) | Not supported. |
| Chrome / Edge | OS-dependent: works on Android and select macOS/ChromeOS builds, not universally across Windows desktop. |
Fixes that work with open-source WASM
Start here if your labels are clean and well-lit.
-
Drop in the `barcode-detector` ponyfill (`zxing-wasm`)
Install
barcode-detector(MIT, backed byApache-2.0zxing-cppcompiled to WASM). It matches the W3CBarcodeDetectorAPI so your scanning code stays portable across Safari, Firefox and Chrome. -
Restrict symbologies and lock camera focus
Pass only the formats your workflow uses (
code_128,ean_13,qr_code) and request 1080p rear-camera video (facingMode: "environment") so narrow 1D bars stay legible. -
Run decoding in a Web Worker
Transfer
VideoFrameorImageDataoff the main thread so continuous scanning does not freeze mobile UI rendering.
import { BarcodeDetector } from 'barcode-detector/ponyfill';
const detector = new BarcodeDetector({
formats: ['code_128', 'ean_13', 'qr_code', 'data_matrix']
});
const codes = await detector.detect(videoElement);Where classical WASM fixes end
zxing-cpprelies on classical binarization (HybridBinarizer) with no neural networks. Read rates drop on handheld motion blur, shiny shrink-wrap glare, curved cans or pharmacy vials, scratched 1D bars and dense pallet codes.- Older wrappers like
html5-qrcodehave been unmaintained since April 2023, and Python packages likeqreaderpullAGPL-3.0(ultralytics) andLGPL(pyzbar) dependencies. - Non-checksummed 1D formats (
Code 39,ITF,Codabar) risk single-frame misreads unless guarded by multi-frame temporal consensus.
Other ways
| Native iOS or Android apps | Apple VisionKit and Google ML Kit cost $0 if you do not need cross-browser web support. |
|---|---|
| Commercial browser WASM SDKs | STRICH (€99–€249/mo), Dynamsoft (from $1,499/yr), Scanbot (from ~$2,500/yr) or Scandit (quote-led): web barcode scanner SDKs. |
| Milliframe, barcode-scan-edge (ours) | 60 fps browser and batch barcode scanner built for damaged, glared, curved and motion-blurred 1D/2D codes at $0 server GPU cost. Free Apache-2.0 Nano, $499/mo Pro (<=50K MAU), or contact us for Business (250K MAU, unlimited subdomains) and Scale OEM. |
Sources
Read on 26 November 2026.
Related
| Web barcode scanner SDKs and prices | STRICH, Dynamsoft, Scanbot, Scandit and zxing-wasm |
|---|---|
| Migrating from Cognex cmbSDK | Code diff for web and WASM barcode apps |
| barcode-scan-edge | Browser WebGPU and batch PDF/video rates |
| Run in the browser | Zero-upload WebGPU/WASM SDK plans |
Not open yet. Be told when it is.
Tell us what you are building and which models you need, and we will write when they open.