From c27e8a109c4f58bdebad9a73cabd21e3d9f5d774 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sat, 25 Apr 2026 12:54:34 -0400 Subject: [PATCH] fix(shopfloor): vendor jsQR so QR scanning works on iOS Safari MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iOS Safari (and the in-app webviews in Messages / WhatsApp / LinkedIn) don't ship the BarcodeDetector API, so the previous scanner fell through to the manual paste UI on every iPhone — defeating the point of "tap to scan." Vendored cozmo/jsQR (Apache 2.0, ~250KB) and made the scanner pick the strongest available decoder at setup time: 1. native BarcodeDetector -> Android Chrome, iOS Safari 17+, desktop 2. jsQR canvas loop -> every other browser with getUserMedia 3. manual URL paste -> last-resort if camera unavailable The jsQR loop draws each video frame into an offscreen canvas, downsamples to 480px on the long side, and runs jsQR synchronously throttled to ~8 fps to stay under 10% CPU on mid-range Android phones. Template now shows the