Barcode Detection API All In One
Barcode Detection API All In One
条形码 / 一维条形码 / 二维条形码(二维码)
https://caniuse.com/?search=Barcode
https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API
https://developer.mozilla.org/en-US/docs/Web/API/BarcodeDetector/getSupportedFormats
demo
function testBarcodeDetector() {
// Feature detection.
if (!('BarcodeDetector' in window)) {
return false;
} else {
// Check supported barcode formats.
BarcodeDetector.getSupportedFormats()
.then((formats) => {
console.log('formats =', formats, typeof formats)
for (const [i, format] of formats.entries()) {
console.log(`BarcodeDetector SupportedFormat ${i} = ${format}`);
}
});
return true;
}
}
testBarcodeDetector();
// true
// formats = (11) ['aztec', 'code_128', 'code_39', 'code_93', 'data_matrix', 'ean_13', 'ean_8', 'itf', 'pdf417', 'qr_code', 'upc_e']
https://cdn.xgqfrms.xyz/geolocation-api/index.html
Shape Detection API
https://web.dev/shape-detection/
https://wicg.github.io/shape-detection-api/
refs
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/16178282.html
未经授权禁止转载,违者必究!