Another option (besides ActiveX or a Java applet with security permissions) could be the Google Native Client and the Pepper API, although this would be enough to access the serial port, I don't know.
The Firefox extension may include its own XPCOM component, which can access the serial port, and you may find that there is already access to the serial port from the chrome browser (which extensions), since the security token and smart card support serial readers. You can also use the Firefox extension to deliver the next solution, which requires you to place your own component or application on the system.
Can you tell us which browsers and OS are targeted here, and why are ActiveX and Java excluded?
Others have proposed their own proxy server, which provides a serial port through some protocol. You can use node for this, or python, or any other language that can create both a serial connection and a socket. To access the proxy server from a browser application, you need special security permissions for the page, and then you can make your proxy server an HTTP or WebSocket server. You can also use javascript from a proxy server, which will provide an HTTP script and WebSocket access to its source server, which is a proxy server. Google Chrome extensions can access any destination and port using their socket client. In addition, I believe that in Google Chrome you can configure the config to allow this for a specific or each page, the same thing that allows you to use your own client on a web page.
Without knowing more about your goal, I cannot determine what the best solution will be.
source share