Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
背景
当前
/pocket-login登录页统一使用autocomplete="one-time-code"。这适合临时访问码,但不适合以下长期有效的凭据:
这些 PIN 更接近普通登录密码。统一使用
one-time-code会影响 Chrome 等浏览器保存和填充长期凭据。登录页此前也无法切换密码可见性,较长的自定义 PIN 输入错误时不容易检查。
凭据分类
新增
credentialKindForHost(host),根据 Host 和当前配置返回:persistentephemeral代理通过可选的
auth.getCredentialKind(host)获取分类。没有提供该回调时默认按
ephemeral处理,避免现有调用方意外启用密码保存。自动填充行为
长期凭据使用
autocomplete="current-password",并提供隐藏且稳定的autocomplete="username"字段,帮助密码管理器识别只有密码的登录表单。Quick Tunnel 自动随机 PIN 使用
autocomplete="off",避免浏览器保存很快就会失效的随机 PIN。密码可见性
登录页增加原生
type="button"可见性控件:aria-label、aria-pressed和title。输入框样式
可见性控件加入后,输入框左右对称预留空间,避免文字和光标被单侧内边距推偏。
同时关闭自动大写和拼写检查,避免密码显示为明文时被浏览器修改或参与拼写检查。
兼容性
token。getCredentialKind。Test plan
npm testautocomplete="current-password"。autocomplete="off"。