Disable native BarcodeDetector on M1/M2 Macs with Ventura

On Macs with an M1/M2 processor and macOS Ventura (macOS version 13), the BarcodeDetector
is broken in Chromium based browsers, regardless of the version. For that constellation,
the BarcodeDetector does not error but does not detect QR codes. Macs without an M1/M2 or
before Ventura are fine. See https://bugs.chromium.org/p/chromium/issues/detail?id=1382442.

Fixes #209
This commit is contained in:
Daniel
2022-11-22 21:01:12 -06:00
parent 34bccc6b27
commit 987bbb06c2
8 changed files with 145 additions and 90 deletions
+15
View File
@@ -122,4 +122,19 @@ declare class BarcodeDetector {
cornerPoints: QrScanner.Point[];
}>>;
}
declare global {
interface Navigator {
readonly userAgentData?: {
readonly platform: string;
readonly brands: Array<{
readonly brand: string;
readonly version: string;
}>;
getHighEntropyValues(hints: string[]): Promise<{
readonly architecture?: string;
readonly platformVersion?: string;
}>;
};
}
}
export default QrScanner;