The performance of the native BarcodeDetector API 1 can be pretty bad 2, causing animations while scanning to be very choppy. Reducing the maximum number of scans per second helps, a bit. Disabling (or removing) window.BarcodeDetector (before calling .start()) makes QrScanner load the worker script and do its detecting there:
delete window.BarcodeDetector;
1: Chrome on non-M1/M2 macOS or Chrome OS or Android only, for now2: In Chrome on my non-M1/M2 Macbook Pro at least, #YMMV
☝️ This is more of a tip than an issue:
The performance of the native BarcodeDetector API 1 can be pretty bad 2, causing animations while scanning to be very choppy. Reducing the maximum number of scans per second helps, a bit. Disabling (or removing) window.BarcodeDetector (before calling
.start()
) makes QrScanner load the worker script and do its detecting there:1: Chrome on non-M1/M2 macOS or Chrome OS or Android only, for now 2: In Chrome on my non-M1/M2 Macbook Pro at least, #YMMV