Firefox flatpak on flathub beta

The application handles extension preferences, updates and removals, but not browsing and installing new extensions. The website is still required for those actions.

Not easily, and it looks difficult to make it easy.

That said, if you don’t mind a pile of hacks and opening up the browser sandbox a fair bit:

  1. make the connector and shell settings available to the flatpak (essentially copies chrome-gnome-shell to a location in HOME that the sandbox has access to)

    MOZDIR=$HOME/.var/app/org.mozilla.firefox/.mozilla
    cd $MOZDIR
    mkdir bin native-messaging-hosts schemas
    cp /usr/share/glib-2.0/schemas/gschemas.compiled schemas
    sed s:/usr:$MOZDIR: /usr/lib64/mozilla/native-messaging-hosts/org.gnome.chrome_gnome_shell.json > native-messaging-hosts/org.gnome.chrome_gnome_shell.json
    # last chrome-gnome-shell release misses commit 3435017550b
    curl https://gitlab.gnome.org/GNOME/chrome-gnome-shell/-/raw/master/connector/chrome-gnome-shell.py | sed '1c #!/usr/bin/python3' > bin/chrome-gnome-shell
    chmod +x bin/chrome-gnome-shell
    
  2. run firefox with a different runtime (to satisfy chrome-gnome-shell dependencies) and with additional permissions

    flatpak run --runtime=org.gnome.Platform//3.36 \
        --own-name=org.gnome.ChromeGnomeShell \
        --talk-name=org.gnome.Shell \
        --env=GSETTINGS_SCHEMA_DIR=$HOME/.var/app/org.mozilla.firefox/.mozilla/schemas \
        --filesystem=xdg-run/dconf --filesystem="~/.config/dconf:ro" \
        --talk-name=ca.desrt.dconf --env=DCONF_USER_CONFIG_DIR=$HOME/.config/dconf \
        org.mozilla.firefox 
    
1 Like