As @Robert Skarzycki noted above, I doubt that you can integrate with the scanner using a web page.
In the issue of intercepting keystrokes.
Add this to the chapter section of your page.
<script type="text/javascript"> window.onload = function() { var barcode = document.getElementById('barcodenum'); barcode.addEventListener("keyup", function() { alert("Please use Barcode Scanner!"); document.getElementById('barcodenum').value = ""; }, true); }; </script>
source share