Files
lhns--steam-frame-nix/docs/firefox.md
T
Pierre Kisters aa9ca183f1 docs: README as overview + options, one docs page per feature
README keeps intro, feature list linking docs/, install, two sessions,
usage, the complete options table, changes outside Nix, rollback,
uninstall. Each feature's details (problem, what you get, configuration,
limitations, how it works) move to its own page in docs/; docs/dashboard.md
is split per feature and docs/changes-outside-nix.md becomes
docs/cleanup.md.
2026-09-29 01:02:28 +02:00

83 lines
3.4 KiB
Markdown

# Firefox
`firefox.*`, module `firefox`. Options:
[README, Options](../README.md#options).
## Problem
In the Steam session gamescope never shows fullscreen windows, so Firefox
looks frozen when a page goes fullscreen; sites send AV1, which the Frame
decodes in software; and the two sessions can't see each other's Firefox,
so a second instance stops at the locked profile.
## What you get
A launcher for the Flathub Firefox Flatpak (`org.mozilla.firefox`, stable;
install it yourself). The launcher shadows the Flatpak's own entry (same
ID), so default-browser associations keep working.
- **`vrFullscreenFix`** (on): `full-screen-api.ignore-widgets` makes
fullscreen fill just the window. Not applied in the desktop profile.
- **`disableAv1`** (off): `media.av1.enabled = false`. The Frame's decoder
driver (`iris`) has no AV1, only H.264, HEVC and VP9, so YouTube and co.
send VP9/H.264, decoded in hardware, instead of software AV1.
- **`prefs`:** further `about:config` values for every profile; they can
also override the fixes above.
- **`desktopProfile`** (`"desktop"`): in the nested desktop the launcher
uses this separate profile (a normal Firefox profile with its own browser
data, created on first use). `null`: the default profile in both sessions.
`prefs` and the fixes are *default* values, not user values: `about:config`
can still change them per profile, and removing one leaves nothing behind.
Changes take effect at the next start of Firefox.
## Configuration
```nix
steamFrame.firefox = {
enable = true;
disableAv1 = true;
prefs."browser.startup.page" = 3; # restore the previous session
};
```
## Caveats
- A `user.js` of your own in the desktop profile is never touched (the
fullscreen fix then stays on there).
- A `org.mozilla.firefox.systemconfig` Flatpak extension of your own would
conflict with the one this module provides.
- **Remove** `vrFullscreenFix` **when** gamescope shows fullscreen X11
windows in VR, `disableAv1` **when** a SteamOS kernel adds AV1 to `iris`.
## How it works
### Default prefs
The prefs are written with `pref()`, and nothing goes to `prefs.js`.
Firefox reads default prefs from `defaults/pref/*.js` in its system config
dir, which in the Flatpak is `/app/etc/firefox`, the mount point of the
`org.mozilla.firefox.systemconfig` extension. home-manager provides that
extension as a link from
`~/.local/share/flatpak/extension/org.mozilla.firefox.systemconfig/aarch64/stable`
to a store directory; Flatpak mounts it itself, so the sandbox doesn't get
`/nix`.
### Desktop profile
The launcher (a desktop entry with the Flatpak's ID) picks `desktopProfile`
when started in the nested desktop. The desktop profile undoes the
fullscreen fix only while its Firefox runs: the launcher links the
profile's `user.js` to `/app/etc/firefox/steam-frame-nix-desktop-user.js`
(a sandbox path) right before starting Firefox, waits for it, and once it
has exited and the profile is no longer in use removes the link and the
value Firefox stored from it in `prefs.js`. A second launch that just hands
a URL to the running Firefox leaves both in place. After a crash, the next
launch or `steam-frame-nix-cleanup` (on switch) removes them.
### Older versions
Older versions linked or copied a `user.js` into every profile; those and
the values they left in `prefs.js` are removed by `steam-frame-nix-cleanup`
on switch, for each profile not in use at that moment.