google-chrome - Chrome 和网络串行 API。如何在不询问的情况下获得端口
问题描述
我需要你的帮助。
有没有办法在不使用弹出窗口的情况下控制先前授权的串行端口?(没有端口 = await navigator.serial.requestPort();)
谢谢你,对不起我的英语,意大利语在这里说。
解决方案
我相信下面的 JS 代码应该适合你:
// Get all serial ports the user has previously granted the website access to.
const ports = await navigator.serial.getPorts();
推荐阅读
- php - 如何在 Auth::attempt 方法中传递 OR?
- postgresql - PostgreSQL - 排序混乱的数据(递归?)
- hive - 无法在 Data Proc Hive Operator 中使用文件进行查询
- android - 在标记顶部设置 MapOverlay 自定义视图时出现 Map Premium 计划问题
- php - 如何在 mpdf 中自动添加第二页?
- java - FetchType.LAZY 不显示外键列
- core-data - 如果调用了所有类(swift4),则更改所有视图控制器的背景颜色
- php - 在 maria db 中导入数据库
- node.js - 如何将我的 nodejs 源代码“上传”到生产服务器?
- python - Django显示未找到的图像