Firefox
Install Firefox via these packages (adjust for your desired locale):
pacman -S firefox firefox-i18n-de
Wayland
Wayland is not yet the default display manager for Firefox (it falls back to XWayland on Wayland). To enableforce nativeFirefox to use Wayland renderingyou in Firefoxcan set the following:MOZ_ENABLE_WAYLAND
environment variable to 1
. Use user specific systemd environment variable configs to set it:
echo "MOZ_ENABLE_WAYLAND=1" >> ~/etc/environment.config/environment.d/moz_wayland.conf
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.draw Set(important to save on battery on laptops).
To ensure Firefox uses hardware decoding ensure the followingfollowing:
- The necessary VA-API drivers are installed (see: Graphics Cards)
- Navigate to
about:support
and ensure that under Compositing it says WebRender (WebRender Software will not work) - Navigate to
about:config
toandenablesethardware accelerated video playback in Firefox:Setting keyValueDescriptiongfx.webrender.alltrueEnable the WebRender compositormedia.ffmpeg.vaapi.enabled
to true
runningEnableVA-API- If
decodermedia.ffvpx.enabledfalseDisable internal VP8/9 software decodersmedia.rdd-vpx.enabledfalseDisable codec sandbox for VP8/9media.navigator.mediadatadecoder_vpx_enabledtrueEnable hardware encoding for WebRTCAlternatively, you can set an environment variable toWayland, enabletheWaylandWebRendermodecompositor:echo "MOZ_WEBRENDER=1" >> /etc/environmentAdditionally, starting within Firefox98,(seeyouabove) - If
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:FFmpegVideo: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
totrue
inabout:config
- Launch Firefox with
GTK_USE_PORTAL=1
environment variable