browserpass-extension icon indicating copy to clipboard operation
browserpass-extension copied to clipboard

Firefox stuck on "Loading available logins..."

Open adham-omran opened this issue 2 years ago • 16 comments

General information

  • OS: NixOS 23.11
  • Browser + version: Firefox 120.0.1 (64-bit)
  • Information about the host app:
    • How did you install it? Installed using Nix's configuration.nix
  • Information about the browser extension:
    • How did you install it? Installed using Firefox extension store
    • Browserpass extension version as reported by your browser: 3.8.0

Exact steps to reproduce the problem

  1. Click on the extension

What should happen?

Show the list of credentials

What happened instead?

Shows "Loading available logins"

Other

This issue does not occur on Chrome.

adham-omran avatar Dec 20 '23 07:12 adham-omran

  1. Do you have any recursive symlinks in your password store directory tree? I'm wondering if it might be looping while scanning the contents of your store.
  2. What does the CPU usage look like when this happens? Is there a core pegged at 100%?
  3. If you point it at an empty directory (instead of wherever it's currently pointed), does the issue still occur?

erayd avatar Dec 20 '23 09:12 erayd

  1. No.
  2. None of the cores see any changes.
  3. How can I change where it is pointing? Under the Firefox preferences for the addon I find error no such native application com.github.browserpass.native

adham-omran avatar Dec 20 '23 11:12 adham-omran

The error seems to indicate that the Firefox browser was not configured for Browserpass, so it can't locate the native host part. There was a link to how to do it in the issue template 😉 Here it is, please give it a try: https://github.com/browserpass/browserpass-native?tab=readme-ov-file#configure-browsers

max-baz avatar Dec 21 '23 00:12 max-baz

The error seems to indicate that the Firefox browser was not configured for Browserpass, so it can't locate the native host part. @maximbaz

I checked it and there is no documentation for a non-stateful NixOS configuration, I'm assuming the options do the host configuration. You can see this in my Nix flake configuration here and here.

adham-omran avatar Dec 21 '23 04:12 adham-omran

Would creating a file under $HOME/.mozilla also be considered stateful? Browsers support configuring native hosts both via a system-wide path and a user-specific path, so make hosts-firefox-user might be all you need to make it work.

https://github.com/browserpass/browserpass-native/blob/master/Makefile#L461

Let me know if adding that file helps!

max-baz avatar Dec 21 '23 07:12 max-baz

I have the same issue with the Chromium Web Browser. It works with Chrome. I ran make hosts-chromium-user from browserpass directory and the syslink was created. At least there was no error.

I installed browserpass-native manually. version: 3.1.0 linux64

linxOD avatar Dec 21 '23 12:12 linxOD

Assuming it's not browserpass/browserpass-native#161 / https://github.com/browserpass/browserpass-native/issues/93 / https://github.com/browserpass/browserpass-native/issues/82, please file a new issue, the content of issue template might help narrow down the case. With the issues like this, when it works in one browser and not another, the issue is almost certainly in the browser configuration (make hosts-*). Try also both -user and system-wide, it's possible that on your environment one path is for whatever reason not respected by the browser, but another one will be.

max-baz avatar Dec 21 '23 13:12 max-baz

I tried -user and system wide. Still not working. Anyway, I might come back to this sometime later.

linxOD avatar Dec 21 '23 13:12 linxOD

Would creating a file under $HOME/.mozilla also be considered stateful? Browsers support configuring native hosts both via a system-wide path and a user-specific path, so make hosts-firefox-user might be all you need to make it work.

https://github.com/browserpass/browserpass-native/blob/master/Makefile#L461

Let me know if adding that file helps!

Unfortunately it does not work, make hosts-firefox-user does not work on NixOS since /usr/ does not work like it does in other distros, it shows the following error

'/home/adham/.mozilla/native-messaging-hosts/com.github.browserpass.native.json' -> '/usr/lib/browserpass/hosts/firefox/com.github.browserpass.native.json'
Error: the symlink points to a non-existent location

adham-omran avatar Dec 30 '23 08:12 adham-omran

I see, so Nix package must be installing that json file in some other location. There are two ways to proceed:

The first one is completely manually. Here's the json file: https://github.com/browserpass/browserpass-native/blob/master/browser-files/firefox-host.json Take it and put it in $HOME/.mozilla/native-messaging-hosts/com.github.browserpass.native.json. There's one placeholder %%replace%% inside the json file, replace it with the full path to the browserpass binary.

Alternatively, locate where the Nix package installed the com.github.browserpass.native.json file (there are two, for Chromium and Firefox, make sure to find the correct one), and create the symlink by hand: ln -s /path/to/located/com.github.browserpass.native.json $HOME/.mozilla/native-messaging-hosts/com.github.browserpass.native.json. The Nix package has hopefully done the placeholder replacement, so you don't need to do that part.

Let me know which one works, if any! :pray:

max-baz avatar Dec 30 '23 11:12 max-baz

Alternatively, locate where the Nix package installed the com.github.browserpass.native.json file

I was able to find it using rg --files | rg 'com.github.browserpass.native.json' while after I cd /. It was in /nix/store/6zvqim62fnnncsp6vyyw3g82bbc86rd4-browserpass-3.1.0/lib/browserpass/hosts/firefox/com.github.browserpass.native.json but I copied it instead of symlinking since I don't know if the path will change or not, I'll see if it breaks and copy again.

The Nix package has hopefully done the placeholder replacement, so you don't need to do that part.

It does!

Let me know which one works, if any! 🙏

The second one, if anyone is coming after me, don't forget to also mkdir /home/$USER/.mozilla/native-messaging-hosts/

adham-omran avatar Feb 25 '24 05:02 adham-omran

I had this issue in Mac. The make hosts-firefox-user was attempting to symlink to somewhere other than where browserpass was installed. When I manually linked to the existing json file it began working fine.

dactylroot avatar May 26 '24 00:05 dactylroot

I had this issue on macOS with Browserpass Native installed via Homebrew.

% make hosts-firefox-user /Users/bart/Library/Application Support/Mozilla/NativeMessagingHosts/com.github.browserpass.native.json -> /usr/lib/browserpass/hosts/firefox/com.github.browserpass.native.json Error: the symlink points to a non-existent location

To fix:

rm ~/Library/Application\ Support/Mozilla/NativeMessagingHosts/com.github.browserpass.native.json
ln -s /usr/local/lib/browserpass/hosts/firefox/com.github.browserpass.native.json ~/Library/Application\ Support/Mozilla/NativeMessagingHosts/com.github.browserpass.native.json
% cat ~/Library/Application\ Support/Mozilla/NativeMessagingHosts/com.github.browserpass.native.json
{
    "name": "com.github.browserpass.native",
    "description": "Browserpass native component for the Firefox extension",
    "path": "/usr/bin/browserpass",
    "type": "stdio",
    "allowed_extensions": ["[email protected]"]
}
sudo vi ~/Library/Application\ Support/Mozilla/NativeMessagingHosts/com.github.browserpass.native.json

Change "path" to /usr/local/bin/browserpass.

louwers avatar Mar 04 '25 22:03 louwers

I believe homebrew package comes with it's own patched Makefile that points to the location where homebrew package places the binary. I definitely realize that homebrew package only prints the instructions once, during the initial installation of the native host, so it's hard to find the steps again.

max-baz avatar Mar 04 '25 22:03 max-baz

Thanks for the hint, made a PR to add that information to the README. https://github.com/browserpass/browserpass-native/pull/155

louwers avatar Mar 05 '25 09:03 louwers

Is there anyone following this thread who still experiences this issue and needs guidance? Looks like both homebrew and Nix have solutions now.

max-baz avatar Apr 01 '25 11:04 max-baz