browserpass / browserpass-extension

Browserpass web extension
ISC License
825 stars 50 forks source link

Firefox stuck on "Loading available logins..." #338

Open adham-omran opened 6 months ago

adham-omran commented 6 months ago

General information


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.

erayd commented 6 months ago
  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?
adham-omran commented 6 months ago
  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
maximbaz commented 6 months ago

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

adham-omran commented 6 months ago

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.

maximbaz commented 6 months ago

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!

linxOD commented 6 months ago

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

maximbaz commented 6 months ago

Assuming it's not #326 / 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.

linxOD commented 6 months ago

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

adham-omran commented 6 months ago

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
maximbaz commented 6 months ago

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:

adham-omran commented 4 months ago

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/

dactylroot commented 1 month ago

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.