網站首頁 編程語言 正文
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getDevices')
at SoftKey3A.FindPort (SoftKey3A.js:278)
at n.<anonymous> (index.js:105)
at s (runtime.js:63)
at Generator._invoke (runtime.js:293)
at Generator.next (runtime.js:118)
at a (asyncToGenerator.js:3)
at s (asyncToGenerator.js:25)
at asyncToGenerator.js:32
at new Promise (<anonymous>)
at n.<anonymous> (asyncToGenerator.js:21)
使用 navigator 讀取識別 ukey,報出這個問題,在本地是可以的,但是在測試環境上就出問題了,報
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getDevices')
查詢了好多地方,各種修改都報錯。
突然詳情,瀏覽器的api是否和ssl有關系,正式環境使用的是 https,使用沒有問題,但是在測試環境使用的http,使用https訪問就不會有這個問題了。
在這兒可以印證需要這個操作
https://developer.mozilla.org/en-US/docs/Web/API/HID
Secure context:?This feature is available only in?secure contexts?(HTTPS), in some or all?supporting browsers.
?
所以,非本地訪問,得使用https訪問。
原文鏈接:https://blog.csdn.net/poem_2010/article/details/122819624
相關推薦
- 2023-04-03 關于CUDA?out?of?memory的解決方案_python
- 2022-04-03 基于QT5實現一個時鐘桌面_C 語言
- 2022-07-21 將本地jar添加到Maven倉庫,使用pom.xml引用
- 2022-10-22 Python基礎Lists和tuple實例詳解_python
- 2023-01-13 pytorch如何定義新的自動求導函數_python
- 2022-12-22 React?Hook?-?自定義Hook的基本使用和案例講解_React
- 2022-09-10 C++中memcpy函數的使用以及模擬實現_C 語言
- 2022-12-08 python第三方庫easydict的使用實例詳解_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支