filips123 / PWAsForFirefox

A tool to install, manage and use Progressive Web Apps (PWAs) in Mozilla Firefox
https://pwasforfirefox.filips.si
Mozilla Public License 2.0
2.07k stars 49 forks source link

Extension does not detect the connector on NixOS #509

Open bashfulrobot opened 1 month ago

bashfulrobot commented 1 month ago

Description

I am installing the extension for the first time on NixOS. I can complete the first two steps when following the wizard, but there is no obvious way to move on to the "Runtime Installation" step. I can see the binaries on my system, and I had no failures in my NixOS rebuild.

I use Home Manager to install/manage Firefox, but your Nix instructions use the regular module. So, I am wondering if that is the issue.

Extension Page image

Binaries image

Nix Config File image

Steps to Reproduce

  1. Install the FF extension
  2. Click on the extension to follow the wizard
  3. Rebuild with my nix config
  4. stuck at the second step

Environment

OS: NixOS 24.11.20240524.bfb7a88 (Vicuña) x86_64 Kernel: Linux 6.6.31 Shell: bash 5.2.26 DE: Gnome 46.1 WM: Mutter (Wayland) Mozilla Firefox 126.0 Extension Version 2.12.1 firefoxpwa 2.12.0

Thank you!

filips123 commented 1 month ago

Yeah, home manager might be the problem. I found this config that may work with HM, but I haven't tested it. If it doesn't work, maybe package maintainers of the NixOS package can help, as I don't have experience with Nix.

Sikeen commented 1 month ago

I have also not been able to get past the Connector Installation, even before starting to use HomeManager. Tried the other config as well.

EmptyVisual commented 1 month ago

Yeah, home manager might be the problem. I found this config that may work with HM, but I haven't tested it. If it doesn't work, maybe package maintainers of the NixOS package can help, as I don't have experience with Nix.

this is not specific to nixos by the way. I'm using Arch Linux with firefox installed from the main repository and I also cant get past the Connector Installation page.

bashfulrobot commented 1 month ago

Yeah, home manager might be the problem. I found this config that may work with HM, but I haven't tested it. If it doesn't work, maybe package maintainers of the NixOS package can help, as I don't have experience with Nix.

Yeah, I had a look at that link. But what that's doing is installing the extension declarative.

What I did is I just installed it through the traditional means. So it's not really applicable. (I think).

Plus, I saw there's another comment on this thread that this is happening on arch as well. Which removes the home manager issue from the equation regardless.

gabenasci commented 1 month ago

I'm having the same problem with Fedora 40, can't get past "Connector installation". I tried installing both from packagecloud and the .rpm package.

bashfulrobot commented 1 month ago

Seems like this is a larger issue and appears not to be platform specific. 🤔

EmptyVisual commented 4 weeks ago

Yeah, home manager might be the problem. I found this config that may work with HM, but I haven't tested it. If it doesn't work, maybe package maintainers of the NixOS package can help, as I don't have experience with Nix.

this is not specific to nixos by the way. I'm using Arch Linux with firefox installed from the main repository and I also cant get past the Connector Installation page.

My issue on Arch was because I was running the Firefox application through Flatpak (so may be a different issue from the original issue posted here). There is no native host messaging set up for flatpaks currently which was why the PWA connector was not able to communicate. I swapped to Firefox through pacman through the Arch repo and it worked. Associated flatpak xdg-desktop-portal bug

filips123 commented 3 weeks ago

Yeah, if you are using Flatpak (or Snap), native messaging won't work. Otherwise, except possible problems with NixOS/HomeManager, it should work fine.

AchyParts commented 2 weeks ago

I had this issue when installing on Mac using Homebrew.

filips123 commented 2 weeks ago

On macOS, you also need to link the manifest, as described in the caveats section. It should be something like this:

sudo mkdir -p "/Library/Application Support/Mozilla/NativeMessagingHosts"
sudo ln -sf "$HOMEBREW_PREFIX/opt/firefoxpwa/share/firefoxpwa.json" "/Library/Application Support/Mozilla/NativeMessagingHosts/firefoxpwa.json"
Sikeen commented 1 week ago

I have also not been able to get past the Connector Installation, even before starting to use HomeManager. Tried the other config as well.

I don't use the flatpak btw

AchyParts commented 1 week ago

On macOS, you also need to link the manifest, as described in the caveats section. It should be something like this:

sudo mkdir -p "/Library/Application Support/Mozilla/NativeMessagingHosts"
sudo ln -sf "$HOMEBREW_PREFIX/opt/firefoxpwa/share/firefoxpwa.json" "/Library/Application Support/Mozilla/NativeMessagingHosts/firefoxpwa.json"

I think I accidentally separated the last line of code before, it worked now.

filips123 commented 1 day ago

So, I think the only remaining issue here is when using NixOS. Problems with Flatpak and Snap are already known and don't need to be additionally reported, and if anyone still has problems on other systems, please create a new issue.

Now, back to the NixOS issue. Maybe @camillemndn or @pasqui23 can help, as they are the maintainers of the package and probably know Nix better than me.

pasqui23 commented 1 day ago

Unfortunately I cannot replicate your problem

camillemndn commented 1 day ago

Hi, I think currently firefoxpwa only supports system-wide Firefox and not Home Manager. I suppose in your case the Home Manager version of Firefox, without PWAs, might take precedence over your Firefox with PWAs. Have you tried which firefox to see whether firefoxpwa appears in the Nix Store Path?