Skip to content

Instantly share code, notes, and snippets.

@erlking
Last active July 27, 2026 10:50
Show Gist options
  • Select an option

  • Save erlking/67d0f9bdd1096d8b622aa2d441823b71 to your computer and use it in GitHub Desktop.

Select an option

Save erlking/67d0f9bdd1096d8b622aa2d441823b71 to your computer and use it in GitHub Desktop.
connect flatpak firefox to flatpak keepassXC - browser integration ( Fedora Silverblue 44, Gnome 50)
# 1. Reset Firefox overrides
flatpak override --user --reset org.mozilla.firefox
# 2. Grant Firefox permission to talk to the Flatpak Portal
flatpak override --user --talk-name=org.freedesktop.Flatpak org.mozilla.firefox
# 3. Create the necessary internal directory structure if it doesn't exist
mkdir -p ~/.var/app/org.mozilla.firefox/data/bin
mkdir -p ~/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts
# 4. Create the Proxy Wrapper Script
# Instead of mounting libraries, this tells Firefox to ask the host
# to run KeePassXC's proxy in its own correct environment.
cat << 'EOF' > ~/.var/app/org.mozilla.firefox/data/bin/keepassxc-proxy-wrapper.sh
#!/bin/sh
# Escaping the Firefox sandbox to execute the proxy on the host
/usr/bin/flatpak-spawn --host flatpak run --command=keepassxc-proxy org.keepassxc.KeePassXC "$@"
EOF
# 5. Make the script executable
chmod +x ~/.var/app/org.mozilla.firefox/data/bin/keepassxc-proxy-wrapper.sh
# 6. Create the JSON Manifest
# We use the absolute /var/home/$USER path because Flatpaks in
# Fedora 44/GNOME 50 often fail to resolve '~' inside manifest files.
cat << EOF > ~/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json
{
"allowed_extensions": [
"keepassxc-browser@keepassxc.org"
],
"description": "KeePassXC integration with native messaging support",
"name": "org.keepassxc.keepassxc_browser",
"path": "/var/home/$USER/.var/app/org.mozilla.firefox/data/bin/keepassxc-proxy-wrapper.sh",
"type": "stdio"
}
EOF
echo "Setup complete. Please restart Firefox and KeePassXC."
@kasraghu

Copy link
Copy Markdown

@erlking

erlking commented Mar 20, 2026

Copy link
Copy Markdown
Author

no

@kasraghu

Copy link
Copy Markdown

I couldn't make it work in my installation (Fedora 44 based Zirconium). Both Firefox and Keepass are installed as sytem Flatpaks.

@GeorgRamer

GeorgRamer commented Apr 9, 2026

Copy link
Copy Markdown

For me it only works when org.freedesktop.portal.Flatpak is replaced by org.freedesktop.Flatpak in line 5.

I am running Flatpak 1.16.3 on Fedora Linux 43 (Silverblue)

@erlking

erlking commented Apr 9, 2026

Copy link
Copy Markdown
Author

thanks, had to change it today on my other pc to org.freedesktop.Flatpak for reasons, updated gist.

@GeorgRamer

Copy link
Copy Markdown

Maybe it is worth to point out somewhere in the comments, what the implication of flatpak override --user --talk-name=org.freedesktop.portal.Flatpak org.mozilla.firefox is? It makes a hole in the sandbox and allows code execution outside on the host system.

@kuvaldini

Copy link
Copy Markdown
    "path": "/var/home/$USER/.var/app/org.mozilla.firefox/data/bin/keepassxc-proxy-wrapper.sh",

this does not on Arch and likely on Debian/Ubuntu/Mint

what you put to app/.../data/bin goes to sandboxed /var/data/bin

@qywx

qywx commented May 25, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment