A major change happened to Firefox recently: Starting from Firefox 57 (released on 2017-11-14), legacy add-ons will no longer be supported. Legacy add-ons refer to those not developed using the new WebExtensions technology.

To be more precise, here’s Mozilla’s official declaration:

Starting from Firefox 53, no new legacy add-ons will be accepted on
addons.mozilla.org (AMO) for desktop Firefox and Firefox for Android.

Starting from Firefox 57, only extensions developed using WebExtensions APIs
will be supported on Desktop Firefox and Firefox for Android.

A direct consequence is the loss of many useful add-ons. At least we have to wait until add-on authors migrate their projects to WebExtensions. On the one hand, some of them were able to do it quickly, but the result looks nothing like its predecessor. On the other hand, some excellent projects have given a clear end-of-life statement.

Downgrade Firefox

So what are our options? Downgrade.

Fortunately, Mozilla still keeps historical versions of Firefox on their servers:

Any version before Firefox 53 should work well with legacy add-ons.

Firefox ESR

Personally, I’d recommend installing ESR versions in this case, because we simply want it to stay old, stay good.

What is Mozilla Firefox ESR?

Mozilla will offer an Extended Support Release (ESR) based on a regular release of Firefox for desktop for use by organizations including schools, universities, businesses and others who need extended support for mass deployments.

What does the Mozilla Firefox ESR life cycle look like?

Maintenance of each ESR, through point releases, is limited to high-risk/high-impact security vulnerabilities and in rare cases may also include off-schedule releases that address live security vulnerabilities. Backports of any functional enhancements and/or stability fixes are not in scope.

Mozilla also provides a ESR release chart:

ESR-Release

In this chart we see the ESR version right before 57 (where the major change happens) is 52. You can download this version using a link provided on the Firefox ESR download page, or by searching its CDN or FTP.

Install Firefox ESR (General)

You can download Firefox ESR 52.8.0 via these links:

The downloaded file firefox-52.8.0esr.tar.bz2 is a tar ball of Firefox ESR 52.8.0 in binary. So you can simply decompress and run.

Install Firefox ESR (Arch Linux)

There is a AUR package firefox-esr-bin. It keeps version 52.8.0. If you want to use another version, you need to modify PKGBUILD.

The script to install firefox-esr-bin version 52.8.0:

git clone https://aur.archlinux.org/firefox-esr-bin.git
cd firefox-esr-bin
git checkout 762330801234fe05be375c627b55add7fcd3fbd7 # commit: updating firefox to 52.8.0
makepkg -s
sudo pacman -U firefox-esr-bin-52.8.0-1-x86_64.pkg.tar.xz

Fix Broken H.264 Playback with Firefox ESR 52.8.0

You may find the installed Firefox ESR 52.8.0 not able to play H.264 videos:

The reason is Firefox ESR 52.8.0 depends on libavcodec.so.57 (or earlier).

Debug script:

strace -e trace=open,openat `which firefox-esr` \
    "https://www.quirksmode.org/html5/tests/video.html" 2>&1 \
    | grep libavcodec

Output:

openat(AT_FDCWD, "/usr/lib/libavcodec-ffmpeg.so.57", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libavcodec-ffmpeg.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libavcodec.so.57", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libavcodec.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libavcodec.so.55", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libavcodec.so.54", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libavcodec.so.53", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

libavcodec.so.57 is provided by FFmpeg 3.4.2 (evidence). If you have upgraded to FFmpeg 4.0.1, then you will have libavcodec.so.58 on your system instead of libavcodec.so.57.

If you have already upgraded to ffmpeg 4.0.1, then you may want to have both versions of FFmpeg installed so that both up-to-date and lecacy programs can work. Basically, this requires you to install an older version of FFmpeg to a separate location (such as /usr/lib/ffmpeg3.4).

Arch Linux

On Arch Linux, there is a AUR package ffmpeg3.4. Simply install it and H.264 playback will work again.

Running the same debug script above gives output:

openat(AT_FDCWD, "/usr/lib/libavcodec-ffmpeg.so.57", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libavcodec-ffmpeg.so.56", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/ffmpeg3.4/libavcodec.so.57", O_RDONLY|O_CLOEXEC) = 79

Fedora

On Fedora, enable RPM Fusion repos:

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Then install these packages:

sudo dnf install ffmpeg ffmpeg-devel compat-ffmpeg28 compat-ffmpeg28-devel

This will make H.264 video playback work in Firefox. If you’d like it to work in Chromium, install one more package:

sudo dnf install chromium-libs-media-freeworld