The state of the web as an application platform makes me a bit sad. In particular, I assumed that scanning barcodes was an extremely solved problem by now.
The reality seems to be that google's old zxing library, and its various ports to javascript is still the best we have. And all the ports are abandonware to various degrees.
Meanwhile, if you're happy to say fuck the web, android and iOS will both be pleased to provide you with "vision APIs" that include barcode scanning. Available as native APIs only, enjoy your nothing in the browser.
Chrome has implemented an experimental "shape detection API" that plugs into native vision APIs to provide barcode scanning and face detection, and is publishing drafts through W3C. Unfortunately it's been 5 years and the other browsers don't seem to give a fuck. Sadly it seems nobody's managed to pitch it just right as an AI feature, that'd get Mozilla and Apple all frothy in the underpants... But, alas.
It's all a bit depressing, really. When zxing was released I remember feeling such optimism for the future of computers, that reasonably fancy image processing were becoming commodity tools. But looking back, seems like it was the high point.