Permissions-Policy: otp-credentials
HTTP Permissions-Policy 标头的 otp-credentials 指令控制当前文档是否允许使用 WebOTP API 从应用程序服务器发送的格式特殊的短信中请求一次性密码 (OTP),即通过 navigator.credentials.get({otp: ..., ...})。
具体来说,如果定义的策略阻止使用此功能,则 navigator.credentials.get({otp}) 返回的 Promise 将会以 SecurityError DOMException 拒绝。
语法
http
Permissions-Policy: otp-credentials=<allowlist>;
<allowlist>-
授予使用该功能的权限的来源列表。有关更多详细信息,请参阅
Permissions-Policy> 语法。
默认策略
otp-credentials 的默认允许列表为 self。
规范
| 规范 |
|---|
| WebOTP API # sctn-permissions-policy |
浏览器兼容性
BCD 表格仅在启用 JavaScript 的浏览器中加载。