1importScripts('/bundles/zbar'); 2 3var isReady = false; 4var zbar = null; 5 6onmessage = function (e) { 7 if (isReady) { 8 // look for codes in the image 9 var results = zbar.scanQrcode(e.data[0], e.data[1], e.data[2]); 10 if (results.length > 0) { 11 postMessage(results[0]); 12 return; 13 } 14 } 15 16 postMessage(false); 17}; 18 19const loadWasmModule = async () => { 20 // load the ZBar wasm module 21 zbar = await Scanner({ 22 locateFile: file => ('/Scripts/zbar.wasm/' + file) 23 }); 24 25 isReady = true; 26} 27 28loadWasmModule(); 29
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.