This is by design. Web workers run in a sandbox. They only communicate with the "outside world" via async postMessage, so you guarantee that they won't disrupt the single-threaded assumption that most JavaScript code make. My suggestion wasn't to put your serial I/O code in the web worker, but to move your CPU-intensive code there, so you can free the main thread to process serial communication faster. First things first: use the performance analysis (about:tracing, devtools timeline and profiles) to make sure this is your problem. You can find that your problem is that the serial API in JavaScript is too slow for your real time requirements. In that case, open a bug at
crbug.com/new . But you can also find that the time your JavaScript code spend processing the data of each serial read is too high. In this case, you can move this processing code to a worker, keep the main thread reading from the serial port and sending incoming serial data to the worker via postMessage.