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

```js-nolint
BarcodeDetector.getSupportedFormats()
```

### Parameters

None.

### Return value

A Promise which fulfills with an Array of
[supported barcode format types](/docs/Web/API/Barcode_Detection_API#supported_barcode_formats).

### Exceptions

No exceptions are thrown.

## Examples

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

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

## Specifications

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

"BarcodeDetector: getSupportedFormats() static method". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector/getSupportedFormats_static

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·