Skip to content

如何在 LibreWolf 上启用 Bitwarden 的生物识别功能

Published: at 04:44

因为 AdGuard 突然在 Arc 浏览器上失效,导致我再次萌生了更换浏览器的想法。记得在 Dayu 的博客上有提到,他在 Chrome 和 Arc 间纠结过后新换了一个开源浏览器 LibreWolf。刚好我早就想逃离 Chrome 的阵营,寻找一款更注重隐私和开源的浏览器,为什么不试一试呢?

Dayu 的文章中有关于 LibreWolf 的简介和他所使用的插件及油猴脚本,我就不赘述了。不得不说,这款浏览器在 macOS 上各方面的表现都不错,这里我也找到了几个常见浏览器的对比,有兴趣的朋友可以看看。

Table of contents

Open Table of contents

遇到的问题

我使用的密码管理器是 Bitwarden,在 LibreWolf 上安装后一直没有办法正常启用生物识别功能(指纹解锁)。虽然可以选择每次输入主密码或者 pin 码解锁,终究还是麻烦,不是我这个懒人的风格。

先去 Bitwarden 的官网查询,看到官方说是支持生物识别的。于是又到 LibreWolf 的官网文档查询,看到了这样一段话:

How do I set up Bitwarden’s biometric authentication?

This is an ongoing issue where we can only help you with a workarround:

Open the Registry Editor and go to Computer\HKEY_CURRENT_USER\SOFTWARE\Mozilla\NativeMessagingHosts\ and/or HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts. Create a new key called com.8bit.bitwarden in the left-side panel of RegEdit (or your registry editor of choice, fellow home users). Set the Default REG_SZ to contain the path to Bitwarden Firefox’s Native Messaging Manifest: ...\browsers\firefox.json. The path may look something like this, your mileage will wary: C:\Users\milk\scoop\apps\bitwarden\current\bitwarden-appdata\browsers\firefox.json.

Once you’ve done that, you should be able to setup the Native Messaging bridge between LibreWolf and Bitwarden for biometric authentication.

我就很恼火,既然是 LibreWolf 官方承认的一直存在的与系统之间的通讯问题,为什么只给出了在 Windows 中的解决方案呢?

于是我又在文档中查询到在 macOS 中密码管理软件 KeePassXC 也存在与系统通讯的问题,解决方案是需要添加一个符号链接(symbolic link):

ln -s ~/Library/Application\ Support/Mozilla/NativeMessagingHosts ~/Library/Application\ Support/LibreWolf/NativeMessagingHosts

好吧,我并不知道这是怎么回事,不过 GPT-4 应该知道。

解决方案

GPT-4 首先让我确保在 macOS 上安装了 Bitwarden 的桌面版,并且在设置中打开了 允许浏览器集成

然后,Bitwarden 的生物识别功能需要访问 NativeMessagingHosts 目录,需要确认或在创建这个目录。

mkdir -p ~/Library/Application\ Support/Mozilla/NativeMessagingHosts

Bitwarden 还需要一个名为 com.8bit.bitwarden.json 的文件存在于 NativeMessagingHosts 目录中。通常,这个文件位于 Chrome 的对应目录下。我们需要创建一个链接将这个文件指向 Mozilla 目录。

ln -s ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/com.8bit.bitwarden.json ~/Library/Application\ Support/Mozilla/NativeMessagingHosts/

接下来,创建一个符号链接,使 LibreWolf 的 NativeMessagingHosts 目录指向 Mozilla 的 NativeMessagingHosts 目录。

ln -s ~/Library/Application\ Support/Mozilla/NativeMessagingHosts ~/Library/Application\ Support/LibreWolf/NativeMessagingHosts

进行完上述步骤后,还需要确认所有的符号链接都已经正确地建立。

ls -l ~/Library/Application\ Support/LibreWolf/NativeMessagingHosts

这时,应该会看到指向 com.8bit.bitwarden.json 的链接,以及指向 Mozilla NativeMessagingHosts 目录的链接。

如此,便大功告成了。重启 LibreWolf,再去 Bitwarden 的浏览器拓展中打开允许生物识别,就可以正常的使用指纹解锁了。

希望这篇文章能帮助遇到类似问题的 LibreWolf 和 Bitwarden 用户,让我们都能够愉快地享受更便捷、更安全的浏览体验。