BarcodeDetector: getSupportedFormats() statische Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Sicherer Kontext: Diese Funktion ist nur in sicheren Kontexten (HTTPS) in einigen oder allen unterstützenden Browsern verfügbar.
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.
Die getSupportedFormats()
statische Methode der BarcodeDetector
-Schnittstelle gibt ein Promise
zurück, das mit einem Array
von unterstützten Barcode-Formattypen erfüllt wird.
Syntax
BarcodeDetector.getSupportedFormats()
Parameter
Keine.
Rückgabewert
Ein Promise
, das mit einem Array
von unterstützten Barcode-Formattypen erfüllt wird.
Ausnahmen
Es werden keine Ausnahmen ausgelöst.
Beispiele
Das folgende Beispiel ruft die getSupportFormat()
statische Methode auf und protokolliert die Ergebnisse in der Konsole.
// check supported types
BarcodeDetector.getSupportedFormats().then((supportedFormats) => {
supportedFormats.forEach((format) => console.log(format));
});
Spezifikationen
Specification |
---|
Accelerated Shape Detection in Images # dom-barcodedetector-getsupportedformats |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getSupportedFormats() static method |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- See implementation notes.
- User must explicitly enable this feature.
- Has more compatibility info.