Move `--disable-eme` to OS- and architecture-specific mozconfigs
Note: this is a twin issue of tor-browser#42501 (closed).
As observed and addressed in tor-browser#31880 (closed), --disable-eme
is an OS-specific option. It turns out that it is also an architecture-dependent option: if --disable-eme
is used when trying to build Firefox for the linux-aarch64
target, the same error of tor-browser#31880 (closed) (mozbuild.configure.options.InvalidOptionError: --disable-eme is not available in this configuration
) makes the build fail. This is because Widevine is the only EME which is available for Linux, and Google does not provide it officially for arm64 Linux, so the eme_choices
function returns None
when building for the linux-aarch64
target (as opposed to every desktop target currently supported by the Mullvad Browser, for which it returns at least one EME). In view of tor-browser-build#12631 and tor-browser-build#32355, the --disable-eme
option should thus be moved from browser/config/mozconfigs/base-browser
to the OS- and architecture-specific mozconfigs
located in the root of the repository, and limited to the OSes and architectures that support it (that is, currently, all the desktop targets supported by the Mullvad Browser). When building the Mullvad Browser, having eme_choices
return None is effectively the same as using --disable-eme
, in that it never #define
s MOZ_WIDEVINE_EME
and thus never sets
pref("browser.eme.ui.enabled", true);
pref("media.gmp-widevinecdm.visible", true);
pref("media.gmp-widevinecdm.enabled", true);
(see, in order, moz.configure#L875, moz.build#L45, firefox.js#L214 and firefox.js#L1830).
Disclaimer: A hack actually exists to use Widevine on arm64 Linux. Indeed, Google distributes Widevine binaries for its aarch64 ChromeOS platforms as part of their aarch64 ChromeOS images. One can thus download those images, extract those binaries, patch them and install them on the system. There's also a package in Fedora that does this automatically, widevine-installer
(it installs a Widevine installer, NOT the Widevine binaries themselves, as Fedora cannot redistribute those). To make Widevine work, the package enables the very same Firefox configurations that --enable-eme
does at the system level (see gmpwidevine.js in the upstream repository). Since the Mullvad Browser uses configuration files (e.g. profile files) which are separate from the system's Firefox's, this hack cannot impact the Mullvad Browser.