-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox extension that uses native messaging does not work #47340
Comments
I'm not sure but it seems that the path where the manifest is looked up is set here. Does anyone that know the code of Firefox can confirm? |
You can add something like |
Sorry if I wasn't clear but this is the problem actually, both options were already set:
But the extensions were not working and Firefox was still complaining that it can't find the extensions with errors like:
|
Just to be sure, are you using |
I'm using the $ realpath $(which firefox)
/nix/store/3d10spgq6fc573ih4wpgjqn7x2iyr8b3-firefox-62.0/bin/firefox
$ l /nix/store/3d10spgq6fc573ih4wpgjqn7x2iyr8b3-firefox-62.0
total 16
dr-xr-xr-x 2 root root 4096 1 janv. 1970 bin
dr-xr-xr-x 3 root root 4096 1 janv. 1970 lib
dr-xr-xr-x 2 root root 4096 1 janv. 1970 nix-support
dr-xr-xr-x 4 root root 4096 1 janv. 1970 share With NixOS unstable (but the problem is here for a long time now): $ nixos-version
19.03pre153158.7df10f388da (Koi) |
See also https://unix.stackexchange.com/questions/437248 I've done some tracing on this: Firefox is not looking in Documentation is sparse on all fronts. I haven't determined what the correct directory should be. One reference said use A temp workaround that did resolve the issue was to copy the manifest jsons under |
Note that the workaround is not resistant to updates. Here is a better implementation using home-manager: {
imports = [
"${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos"
];
nixpkgs.config.firefox.enableBrowserpass = true;
nixpkgs.config.firefox.enableGnomeExtensions = true;
home-manager.users.MYUSER = {
home.file.".mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json".source = "${pkgs.browserpass}/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json";
home.file.".mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json".source = "${pkgs.chrome-gnome-shell}/lib/mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json";
};
}
|
Nice! Thanks for the tip. The post-update issue, in my case, was observed as a "error" reported on accessing https://extensions.gnome.org/ . |
I decided to open https://bugzilla.mozilla.org/show_bug.cgi?id=1538954 to surface this discussion within Mozilla because the patch shipped in Nixpkgs only covers the |
Oh btw, I added better instructions to browserpass for Nix/NixOS recently, in browserpass/browserpass-legacy#308: https://github.com/browserpass/browserpass#configuring-browserpass-on-nixos--for-nix |
This came up when I was helping someone on mastodon https://mastodon.social/web/statuses/103631567654364956. |
thanks @worldofpeace for walking me through that. I was very confused why it wasn't working and had not even thought about checking with a different install of firefox. using the non bin version it now works as expected. |
Hello, I'm a bot and I thank you in the name of the community for opening this issue. To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them. Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel. |
we could make that path exist ...
... or use a ld_preload library to resolve fstat/open syscalls from
edit: no, firefox is statically linked → maybe there is a fork of firefox, where either MOZ_SYSTEM_DIR is parsed, |
I marked this as stale due to inactivity. → More info |
So I have This seems to have done the job though, so the note on the wiki seems incorrect: $ ls -l $(dirname $(readlink $(which firefox)))/../lib/mozilla/native-messaging-hosts/
total 0
$ nano ~/.nixpkgs/config.nix
$ cat ~/.nixpkgs/config.nix
{
firefox.enablePlasmaBrowserIntegration = true;
# ... the rest of my `config.nix` file ...
}
$ nix-env -iA nixos.firefox
replacing old 'firefox-103.0.2'
installing 'firefox-103.0.2'
this path will be fetched (0.57 MiB download, 4.82 MiB unpacked):
/nix/store/6c79h7gb5gvgpd4938yxg2zdffbd3h2j-firefox-103.0.2
copying path '/nix/store/6c79h7gb5gvgpd4938yxg2zdffbd3h2j-firefox-103.0.2' from 'https://cache.nixos.org'...
building '/nix/store/bqgyzgm7xpn5pgd9rnx3w7xrxw0m46ip-user-environment.drv'...
$ ls -l $(dirname $(readlink $(which firefox)))/../lib/mozilla/native-messaging-hosts/
total 9
lrwxrwxrwx 1 root root 152 Jan 1 1970 org.kde.plasma.browser_integration.json -> /nix/store/s718ag183gd8chm757gzy49i1wdh306p-plasma-browser-integration-5.25.4/lib/mozilla/native-messaging-hosts/org.kde.plasma.browser_integration.json So it seems like Now to restart Firefox and see if it really works! EDIT: yupp, finally have Plasma Browser Integration working in Firefox! (I think I only ever had it working in Chromium accidentally because I had that installed system-wide from ages ago, hah) |
Is |
Yes, it should just be |
I managed to get it working on |
I think this commit SuperSandro2000@cb6a879 fixes this. Can someone confirm this? |
FYI the workaround described here was not necessary in anymore in 23.05 but after updating to 23.11 browserpass seems to be broken again.
So I've re-enabled the workaround but the native extension name has changed. The new version is: home.file.".mozilla/native-messaging-hosts/com.github.browserpass.native.json".source = "${pkgs.browserpass}/lib/mozilla/native-messaging-hosts/com.github.browserpass.native.json"; |
Please test #303562 |
Sorry. I just tried, and the problem is still there even after restarting firefox. Same error:
I do have in my config:
|
This works for me. |
I tried for a long time now to make browserpass and gnome-extensions firefox plugins to work in NixOS without success. I find out that these two extensions are using the Native Messaging interface, that is used by Firefox to interact with local applications. So, looking at the Firefox debug console, I get this error:
It seems that the extension manifest was not found.
I finally find out where it comes from, thanks to this issue #33748. This comment is giving the problem cause and the workaround:
#33748 (comment)
Basically, the problem comes from Firefox looking for a path in
/usr/lib/
that does not exist in NixOS and the workaround is to create a link in the user's home with:A bug was open in the Firefox side two years ago, but maybe a small patch would do the trick ;)
I'm opening a new issue because the previous one was too specific on browserpass and closed because of another issue with gpg that was fixed.
The text was updated successfully, but these errors were encountered: