无法在 Chrome 中找到 OTPCredential

sud*_*ngh 5 html javascript google-chrome

我正在尝试在网络中构建 OTP 自动读取。我读到 Chrome 提供了 OTPCredential(此处)。'OTPCredential' in window但是,即使版本高于 84,我尝试的每个移动 chrome 浏览器上的检查也会失败。他们现在删除了支持吗?

Car*_*ges 0

检查一下navigator.credentials,当设备收到包含请求 URL 和代码的 OTP SMS 消息时,它会返回Promise包含一次性密码(代码)的解析:

navigator.credentials.get({otp: {transport: ['sms']}})
Run Code Online (Sandbox Code Playgroud)