You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The BarcodeDetector polyfill fetches a WASM file at runtime from a
CDN. That's a problem for offline applications or applications that
run in a network with strict CSP policy. As a workaround the polyfill
exports a function to configure the WASM file URL. So we re-export
the function here.
Also, by default the BarcodeDetector polyfill installs itself by setting
`globalThis.BarcodeDetector` but only if there is no native support.
This is likely not SSR compatible. Also, native support `BarcodeDetector`
is inconsistent. For example, Chrome on MacOS does support `BarcodeDetector`
but does not support `Blob` inputs, violating the specification. To have
a more consistent support we simply always use the polyfill on all
platforms. That likely comes as at a performance cost in raw scanning speed
on supporting platforms but the download penalty is paid either way.
See #354#353
0 commit comments