Skip to content

Fix/firefox esr profiles#1179

Open
4in4in wants to merge 3 commits into
black7375:masterfrom
4in4in:fix/firefox-esr-profiles
Open

Fix/firefox esr profiles#1179
4in4in wants to merge 3 commits into
black7375:masterfrom
4in4in:fix/firefox-esr-profiles

Conversation

@4in4in

@4in4in 4in4in commented Jun 23, 2026

Copy link
Copy Markdown

Describe the PR

install.sh failed on a fresh Kubuntu (KDE Plasma 6.x) install with firefox-esr:

FAILED: Unable to find profiles.ini at /home/<user>/.var/app/io.gitlab.librewolf-community/.librewolf

There is no Flatpak and no LibreWolf on the machine, yet the script aborts pointing at a LibreWolf path. Two independent problems cause this:

  1. firefox-esr profile dir was not in the candidate list. On Debian/Ubuntu the firefox-esr package stores its profile in ~/.mozilla/firefox-esr/ (not ~/.mozilla/firefox/), so the profile was never found.

  2. check_profile_ini aborted on the first existing candidate dir without profiles.ini. It required every existing candidate dir to contain profiles.ini and exit 1-ed on the first one that didn't — even though a perfectly valid profile dir was also present.

Why that LibreWolf dir exists without Flatpak

On KDE Plasma 6.x, plasma-browser-integration ships a flatpak-integrator component (the "Plasma Browser Integration Flatpak Integration" background service) that pre-creates native-messaging-host directories for a hardcoded list of Flatpak browsers — even when neither Flatpak nor that browser is installed. The browser list and target path come straight from its source (flatpak-integrator/plugin.cpp):

{BrowserBase::Firefox, u"org.mozilla.firefox"_s,           u"/.mozilla/native-messaging-hosts"_s},
{BrowserBase::Firefox, u"io.gitlab.librewolf-community"_s, u"/.librewolf/native-messaging-hosts"_s},
// path: QDir::homePath() + "/.var/app/" + browser.id
// comment: "always create integration regardless of the browser being installed
//           so we can be ready for if it is installed"

So ~/.var/app/io.gitlab.librewolf-community/.librewolf/ is created as an empty stub (no profiles.ini). It passes the existing -d filter in check_profile_dir, then aborts check_profile_ini. This component is new in Plasma 6.x (Debian/Ubuntu plasma-browser-integration ~6.3.x); Plasma 5.27 is unaffected, which is why this surfaces on recent KDE distros.

Changes

  • Add ~/.mozilla/firefox-esr to firefoxProfileDirPaths.
  • Make check_profile_ini tolerant: keep only the dirs that actually contain profiles.ini, and error out only when none do. Dirs without profiles.ini (e.g. the KDE stub) are now skipped instead of being fatal, and each skip is logged via a new non-fatal lepton_warn_message so the behavior is visible:
    WARNING: Skipping /home/<user>/.var/app/io.gitlab.librewolf-community/.librewolf (no profiles.ini)
    
  • Downstream functions benefit too, since they iterate over the cleaned-up list.

No behavior change for setups that already worked: a single valid profile dir still passes exactly as before.

PR Type

  • Add: Add feature or enhanced.
  • Fix: Bug fix or change default values.
  • Clean: Refactoring.
  • Doc: Update docs.

Related Issue

Screenshots

Not applicable (install script change).

Additional context

Reproduction: fresh Kubuntu with the default Plasma 6.x desktop (plasma-browser-integration installed) + firefox-esr, no Flatpak. Tested on a real system — install now detects ~/.mozilla/firefox-esr, skips the empty KDE stub dir with a warning, and applies the theme correctly.

References:

4in4in added 3 commits June 23, 2026 14:53
…rofiles.ini

- Add ~/.mozilla/firefox-esr to the profile dir candidates so Debian/Ubuntu
  firefox-esr installs are detected.
- check_profile_ini no longer aborts on the first candidate dir that lacks
  profiles.ini. It now keeps only dirs that actually contain profiles.ini and
  errors only when none do. This fixes a failure on KDE/Kubuntu where
  plasma-browser-integration pre-creates empty
  ~/.var/app/io.gitlab.librewolf-community/.librewolf native-messaging-hosts
  stubs (no flatpak/librewolf required), which previously aborted install with
  "Unable to find profiles.ini".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant