I want to access the serial port navigator.serial.requestPort()
in web worker, but I get this error:
Uncaught (in promise) TypeError: navigator.serial.requestPort is not a function
How can I fix this?
You can't call requestPort from a worker, you'll need to call requestPort in the main application code then tell the worker to open the port.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.