Firefox Tomorrow

web api static method

BarcodeDetector: getSupportedFormats() static method

View on MDN ↗

Secure contextAvailable in workersLimited availability

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

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.