Skip to content

Replace supportedFormats with static getSupportedFormats() method #54

@reillyeon

Description

@reillyeon

The problem with the current supportedFormats attribute are two-fold,

  1. The property can be read synchronously which is incompatible with modern user agent designs which run script in a sandboxed process and so would have to cache the value of this attribute at startup in order to provide its value synchronously or pause script execution until it can be fetched asynchronously.
  2. While a developer can select the barcode formats they would like to use through BarcodeDetectorOptions they must first create a new BarcodeDetector in order to get access to this property.

This attribute should instead be (a) static and (b) a method returning a Promise.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions