我想在Chrome密码管理器中为一个网站添加密码,但Chrome没有提供保存按钮(即它无法识别密码字段)。因此,我想手动添加密码。我知道如果Chrome甚至无法将该字段识别为密码字段,则不会自动填充,但至少我知道在哪里查找它...
我想问如何操作,但根据谷歌搜索的答案,我的问题是:是否有可能?
我想问如何操作,但根据谷歌搜索的答案,我的问题是:是否有可能?
--enable-features=PasswordImport
启动Chrome(chrome://flags/下的设置不再存在)。有关详细信息,请参见Chromium错误跟踪器中的Issue 1021518:Chrome FR:在Chrome78上无法在设置中导入密码。Create a CSV file for the entry. The first line lists the columns, then each line represents one password manager entry, with the site name, username and password. The file will look like this:
name,url,username,password
example.org,https://example.org/,user,secret
example2.org,https://example2.org/,anotheruser,extrasecret
[...]
替代方案: 使用Google账户管理密码
如果您有一个Google账户,并且在Google Chrome中启用了同步功能, 您也可以在Google账户中管理已保存的密码(位于https://passwords.google.com/options下)。
相比修改命令行参数和处理文本文件,这可能更容易;但是,同步(以及Google账户总体上)涉及许多隐私问题,因此您需要决定是否为了方便而值得使用。
感谢Omkar Rajam提出此建议。
chrome://settings/passwords
中显示“导入”按钮。 我甚至使用--enable-features=PasswordImport
选项重新启动了Chrome - 并且我也能够在chrome://flags/#PasswordImport
下检查PasswordImport
。 - Josiah Yoder如此所述 https://developer.mozilla.org/fr/docs/Web/API/PasswordCredential 。
访问您想要保存密码的站点,打开开发者工具并键入:
const cred = new PasswordCredential({
id: '<site user>', // ex: myLoginUser@mail.com
password: '<site password>',
name: '<name>', // how it appears in password manager
});
navigator.credentials.store(cred) // Will prompt you to save the password
.then(() => {
// Do something or not
});
navigator.credentials.store(new PasswordCredential({id: '<site user>', password: '<site password>', name: '<name>'})).then(() => {});
但是对我来说不起作用...
我在这个页面尝试了navigator.credentials.store(new PasswordCredential({id: 'testUser', password: 'qqqwww', name: 'TestUserStoring'})).then(() => {alert("ok")});
,但密码中没有添加任何内容... - Nashevname,url,username,password
example.org,https://example.org/,user,secret
前往https://passwords.google.com/options?ep=1,使用与 Chrome 相同的用户凭证登录,并在“导入密码”下方单击“导入”,然后转到正在尝试保存密码的页面,您应该看到已填充您的密码,就这么简单!
<input type="password">
元素,Chrome 浏览器会在导航栏中添加一个小钥匙图标,并让您保存密码到实际的域名(而不是 localhost)。 - ssc-hrep3我找到了一个简单的方法。
然后,在桌面上进入密码管理器,编辑已保存的密码,并手动替换为您的实际密码。
下次访问该网站时,您可以自动填充密码。
请注意,这需要字段具有type="password"属性。