This change modifies the behavior of BarcodeDetector.getSupportedFormats() such that it resolves with an empty array when barcode detection is not supported by the platform, rather than rejecting.
This matches the behavior in Chromium which is based on developer feedback indicating that this makes feature detection easier as otherwise developers must handle rejection and check that the desired format is present in the result.
This change modifies the behavior of
BarcodeDetector.getSupportedFormats()
such that it resolves with an empty array when barcode detection is not supported by the platform, rather than rejecting.This matches the behavior in Chromium which is based on developer feedback indicating that this makes feature detection easier as otherwise developers must handle rejection and check that the desired format is present in the result.
Preview | Diff