Skip to main content

Firefox

Install Firefox via these packages (adjust for your desired locale):

pacman -S firefox firefox-i18n-de

Wayland

To enable native Wayland rendering in Firefox set the following:

echo "MOZ_ENABLE_WAYLAND=1" >> /etc/environment

Alternatively, navigate to about:config and set gfx.webrender.all to true to enable WebRender compositor.

Media Playback

Autoplay in background

Firefox prevents autoplay for media of tabs that aren't currently active, which causes apps like Plex to take very long to skip to the next track after the current one has ended. The following setting in about:config can be used to disable this behavior:

Setting key Value Description
media.block-autoplay-until-in-foreground false Enable autoplay when tab is not currently active

Hardware Decoding

Utilizing GPU hardware accelerated decoding of video content results in smoother playback of HD/4K content, while reducing CPU load and power draw. Set the following in about:config to enable hardware accelerated video playback in Firefox:

Setting key Value Description
gfx.webrender.all true Enable the WebRender compositor
media.ffmpeg.vaapi.enabled true Enable VA-API decoder
media.ffvpx.enabled false Disable internal VP8/9 software decoders
media.rdd-vpx.enabled false Disable codec sandbox for VP8/9
media.navigator.mediadatadecoder_vpx_enabled true Enable hardware encoding for WebRTC

Alternatively, you can set an environment variable to enable the WebRender compositor:

echo "MOZ_WEBRENDER=1" >> /etc/environment

Additionally, starting with Firefox 98, you need to disable the RDD sandbox in order to use VA-API hardware accelerated video decoding. Otherwise no videos will play:

echo "MOZ_DISABLE_RDD_SANDBOX=1" >> /etc/environment

To test if Firefox is actually using VA-API to decode video you can launch it with the following command:

MOZ_LOG="PlatformDecoderModule:5" firefox 2>&1 | grep 'VA-API'

If your log output reads something like the following video decoding via VA-API is working.

[Child 55975: MediaPDecoder #3]: D/PlatformDecoderModule VA-API Got one frame output with pts=135468000dts=135468000 duration=17000 opaque=-9223372036854775808
[Child 55975: MediaPDecoder #3]: D/PlatformDecoderModule Reusing VA-API DMABufSurface UID = 10

KDE Plasma Integration

Control media playback from KDE

For better integration of Firefox into the KDE Plasma desktop, install the Plasma Integration add-on either via the Mozilla Add-on page or via AUR:

TIP: To prevent duplicate entries in the Media Player widget or tray icon, set media.hardwaremediakeys.enabled to false. This disables the media entry from Firefox and only uses the one from the Plasma integration add-on.

yay -S firefox-extension-plasma-integration

Make Firefox use KDE Dialogs

By default, Firefox uses GTK file and print dialogs, even on KDE. To change this to KDE native dialogs set one of the following:

  • Set widget.use-xdg-desktop-portal to true in about:config
  • Launch Firefox with GTK_USE_PORTAL=1 environment variable