MDN self-hosted library · e01.org

BarcodeDetector: getSupportedFormats() static method

Barcode Detector API

Barcode Detector API

The getSupportedFormats() static method of the BarcodeDetector interface returns a Promise which fulfills with an Array of supported barcode format types.

Syntax

BarcodeDetector.getSupportedFormats()

Parameters

None.

Return value

A Promise which fulfills with an Array of supported barcode format types.

Exceptions

No exceptions are thrown.

Examples

The following example calls the getSupportedFormats() static method and logs the results to the console.

// check supported types
BarcodeDetector.getSupportedFormats().then((supportedFormats) => {
  supportedFormats.forEach((format) => console.log(format));
});

Specifications

Browser compatibility