Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 10302  / 1 Year ago, fri, april 21, 2023, 8:09:54

How can I get this back to work ? My whole password manager integration is now broken thanks to snap. People with 1password will have the same problem.


Regarding "duplicate for ppa install over snap" I'll copy my comment: technically yes, but it's a nice hack and ultimately a workaround (and if you're just trying to get some native transport working after upgrading, it is not the thing you'll search for).


More From » snap

 Answers
0

Update: Native messaging support in the Firefox snap is now available as beta. Beware that this is pretty fresh - the code hasn't been merged upstream, yet, so don't expect this to be production-ready. There is also a German article by Heise Online with a step-by-step guide on how to get this going - in case you want to give it a try.




Unfortunately this issue can't be fixed on KeePassXC's end and so far neither Flatpak nor Snap support NativeMessaging, yet (their sandboxing techniques prevent the browser extension from talking to the KeePassXC process). While work on a solution is in progress, all we can do is work around this issue (or switch to a distro which still provides browsers as regular packages like Debian). The KeePassXC Troubleshooting guide recommends installing the browser from the official PPA. This isn't pretty but the following approach worked for me:



  1. Uninstall the Firefox snap
    sudo snap remove firefox


  2. Ubuntu provides a transitional firefox Debian package which installs the Snap. We need to ensure that packages from Mozilla's PPA have higher priority (otherwise apt might "upgrade" to the Snap again).
    echo '
    Package: firefox
    Pin: release o=LP-PPA-mozillateam
    Pin-Priority: 1001
    ' | sudo tee /etc/apt/preferences.d/mozilla-firefox

    If you are using unattended-upgrades you also need to run the following to ensure unattended-upgrades takes the Mozilla PPA into account:
    echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox


  3. Install Firefox from Mozilla's PPA:
    sudo add-apt-repository ppa:mozillateam/ppa
    sudo apt update
    sudo apt install firefox


  4. Disable AppArmor for Firefox to ensure the Firefox extension can connect to KeepassXC:
    sudo ln -s /etc/apparmor.d/usr.bin.firefox /etc/apparmor.d/disable/
    sudo apparmor_parser -R /etc/apparmor.d/usr.bin.firefox


  5. Run KeePassXC and enable browser integration (menu Tools -> Settings -> Browser Integration, tick "Enable browser integration" and "Firefox").

  6. Run Firefox, open settings of the KeePassXC extension -> Connected Databases -> Connect.


Disclaimer


This approach has the drawback that AppArmor is disabled completely - beware that this weakens security. Maybe someone with more AppArmor experience can contribute a safer way to get NativeMessaging working again?


Troubleshooting


A few tips in case you run into issues:



  • You can check whether you are running the Snap version or the regular version of Firefox by opening Help -> About Firefox. If the version number doesn't mention "Snap" you are running the regular version:
    enter image description here

  • You can check the apt priorities by running apt-cache policy firefox. Verify that the Mozilla PPA has higher priority than the official Ubuntu repository. The output might look like this:
    $ apt-cache policy firefox
    firefox:
    Installed: 101.0.1+build1-0ubuntu0.22.04.1~mt1
    Candidate: 101.0.1+build1-0ubuntu0.22.04.1~mt1
    Version table:
    1:1snap1-0ubuntu2 500
    500 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
    *** 101.0.1+build1-0ubuntu0.22.04.1~mt1 1001
    500 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
    100 /var/lib/dpkg/status



[#635] Sunday, April 23, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
errettas

Total Points: 160
Total Questions: 118
Total Answers: 91

Location: Laos
Member since Fri, Sep 11, 2020
4 Years ago
errettas questions
Tue, Jan 10, 23, 22:58, 1 Year ago
Sun, Aug 22, 21, 23:47, 3 Years ago
Tue, Aug 3, 21, 20:06, 3 Years ago
Fri, Aug 20, 21, 21:58, 3 Years ago
;