很久很久之前,刚刚装上KDE Plasma的时候,觉得Kwallet难用,而且总是弹出来,就直接给关掉了。于是乎,Chrome的密码就一直没能保存上,也没有自动填充,今天终于忍无可忍,行动起来把它配置好了,也稍微踩了一点坑,不过配置好之后发现其实也就两步而已,非常简单。

步骤

1. 启用Kwallet

这个通过KDE自带的配置就行。

Kwallet配置

2. 配置Chrome的启动参数

编辑用户的Chrome启动参数配置,根据操作系统的不同,路径也不一样,以Linux的配置文件~/.config/chrome-flags.conf为例。 在配置文件中添加以下启动参数:

1
--password-store=kwallet5

踩坑

1. 启动参数写错

Chrome的man page中是这样的:

–password-store=<basic|gnome|kwallet>

Set the password store to use. The default is to automatically detect based on the desktop environment. basic selects the built in, unencrypted password store. gnome selects Gnome keyring. kwallet selects (KDE) KWallet. (Note that KWallet may not work reliably outside KDE.)

kwallet默认对应KDE4,如果要使用KDE5的话需要修改为kwallet5,man page一直没有更新。

2. 配置好之后无法同步密码

错误如下:

1
[ERROR:password_syncable_service.cc(193)] Passwords datatype error was encountered: Failed to get passwords from store.

解决办法是删掉原有的密码数据,参考Fixing a Google Chrome failure to save passwords

  1. 退出Chrome
  2. 打开对应的Chrome用户数据目录,不同平台对应路径的不一样
操作系统 路径
Mac ~/Library/Application Support/Google/Chrome
Linux ~/.config/google-chrome
Windows %UserProfile%\AppData\Local\Google\Chrome\User Data
  1. 在上一步的路径下,主用户的配置文件存放在Default,其他用户会以Profile 1Profile 2命名,可以修改多个用户的配置,一般只需要修改Default
  2. 删除掉Login DataLogin Data-journal两个目录。
  3. 重复上述步骤,对其他用户进行操作。