-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbarcode.js
More file actions
27 lines (23 loc) · 706 Bytes
/
Copy pathbarcode.js
File metadata and controls
27 lines (23 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import {
setModuleArgs
} from '@undecaf/zbar-wasm';
// setModuleArgs({
// locateFile: (file) => "/assets/zbar-dxhbfb38b727d251423.wasm"
// });
function loadBarcodeDetectorPolyfill(args) {
setModuleArgs(args);
import('@preflower/barcode-detector-polyfill').then(({
BarcodeDetectorPolyfill
}) => {
window.BarcodeDetector = window.BarcodeDetector || BarcodeDetectorPolyfill;
});
}
import {
BarcodeDetectorPolyfill
} from '@preflower/barcode-detector-polyfill';
try {
window['loadBarcodeDetectorPolyfill'] = (args) => {};
window['BarcodeDetector'].getSupportedFormats()
} catch {
window['loadBarcodeDetectorPolyfill'] = loadBarcodeDetectorPolyfill;
}