#1067472 firefox-esr: Firefox and Firefox ESR should implement update-alternatives and provide a seperate binary

Package:
firefox-esr
Source:
firefox-esr
Description:
Mozilla Firefox web browser - Extended Support Release (ESR)
Submitter:
Wesley Schwengle
Date:
2024-03-22 03:27:04 UTC
Severity:
normal
#1067472#5
Date:
2024-03-22 03:22:57 UTC
From:
To:
Dear Maintainer,

I went digging for how firefox works on Debian because I want to make a partial
switch from Google Chrome to firefox. There are some things that could be
improved I think. Mainly by starting to make use of update-alternatives.

I want to start of with by saying this bug is more or less a combination of
bugs #1001724 and #1033594. They both address why I have this wish, for
different reasons.

/usr/bin/firefox is a wrapper script to which looks for $FIREFOX.real, where
$FIREFOX is assuming, firefox. It looks for command firefox, which may be
something else if the user has a wrapper script itself in their PATH and this
than misses its target, #1001724 in short.

The easy way to solve this is IMO a update-alternatives group for firefox like
Google Chrome does (via the Google repo). They have an update-alternatives
group, aptly named `google-chrome', which provides `/usr/bin/google-chrome' and
as a user you can change this to have google-chrome-{unstable,beta,stable} as
your google-chrome. Instead of the wrapper script, firefox-esr should provide
firefox-esr. The firefox package should provide firefox-stable (or similar) and
install itself at a higher level than firefox-esr. This way the firefox binary
"overrides" the ESR. At least, that is my take on it, feel free to swap the
priorities around.

It would be nice if the upstream firefox packages, also adhere to this, eg,
firefox-nightly is already installed as firefox-nightly, but doesn't add an
update-alternatives.

Another reason, besides the wrapper script, is that firefox doesn't really put
profiles in a different path, eg, `~/.config/firefox-nightly',
`~/.config/firefox', etc etc. They however in their compatibility.ini, eg in
`~/.mozilla/firefox/rqowq6li.default-esr/compatibility.ini', you can see a
LastPlatformDIr, which is for the nightly version:

  LastPlatformDir=/usr/lib/firefox-esr

Now, when I run `readlink -m /usr/bin/firefox-nightly' it returns
`/usr/lib/firefox-nightly/firefox'. The LastPlatformDir is the dirname of the
binary. Now, with a propper update-alternative I can also do this on the binary
`/usr/bin/firefox', as this will point to `/etc/alternatives/firefox', which in
turn links to `/usr/bin/firefox-nightly', which is
`/usr/lib/firefox-nightly/firefox'. I can do a little bit of magic with some
shell scripts to startup firefox profiles for different versions.

The wrapper script blocks this from working:

  $ readlink -m /usr/bin/firefox
  /usr/bin/firefox

I hope to see this wish become reality :)


Cheers,
Wesley