[英]Chrome & Web Serial API. How to get port without asking
我需要你的帮助。
有没有办法在不使用弹出窗口的情况下控制先前授权的串行端口? (没有端口 = 等待 navigator.serial.requestPort(); )
谢谢你,对不起,我在这里说英语,意大利语。
我相信下面的 JS 代码应该适合你:
// Get all serial ports the user has previously granted the website access to.
const ports = await navigator.serial.getPorts();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.