From 3d4cfededf3c73747b309d803887125d278638aa Mon Sep 17 00:00:00 2001 From: The412Banner Date: Sun, 20 Sep 2026 04:51:50 -0400 Subject: [PATCH] Desktop: keep Firefox out of Work Offline, and probe the network in debug runs Firefox decides whether it is online by dumping the routing table over netlink, which Android denies to apps; it sees no default route, switches to Work Offline and every page fails while the network is fine. A defaults file staged into Firefox's pref directory turns that off, and drops the process sandboxes that have nothing to set up under proot. Debug runs now log a name lookup and a fetch over IPv4 and IPv6 from inside the session. --- .github/workflows/build.yml | 1 + .../launcher/session/SessionFiles.kt | 1 + tools/linuxfs/desktop/autostart | 10 ++++++++++ tools/linuxfs/desktop/firefox-steamdeck.js | 19 +++++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 tools/linuxfs/desktop/firefox-steamdeck.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df9eede6f9..51c5d52903 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,6 +96,7 @@ jobs: install -Dm644 tools/linuxfs/desktop/autostart "$D/etc/xdg/labwc/autostart" install -Dm644 tools/linuxfs/desktop/rc.xml "$D/etc/xdg/labwc/rc.xml" install -Dm644 tools/linuxfs/desktop/panel.conf "$D/etc/xdg/lxqt/panel.conf" + install -Dm644 tools/linuxfs/desktop/firefox-steamdeck.js "$D/usr/lib/firefox/defaults/pref/steamdeck.js" ls -lR "$D" # Runs whether the preloads were built or restored: readelf reads any ELF whatever the host, diff --git a/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt b/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt index 5064067ff5..89094434c3 100644 --- a/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt +++ b/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt @@ -39,6 +39,7 @@ object SessionFiles { "etc/xdg/labwc/autostart" to "etc/xdg/labwc/autostart", "etc/xdg/labwc/rc.xml" to "etc/xdg/labwc/rc.xml", "etc/xdg/lxqt/panel.conf" to "etc/xdg/lxqt/panel.conf", + "usr/lib/firefox/defaults/pref/steamdeck.js" to "usr/lib/firefox/defaults/pref/steamdeck.js", ) val all = if (File(root, "usr/bin/labwc").isFile) files + desktop else files for ((asset, relative) in all) { diff --git a/tools/linuxfs/desktop/autostart b/tools/linuxfs/desktop/autostart index 41a9fccb89..2a19230148 100644 --- a/tools/linuxfs/desktop/autostart +++ b/tools/linuxfs/desktop/autostart @@ -14,6 +14,16 @@ run() { } # The output at the app's real size, in case rc.xml's mode did not take. [ -n "${BL_WIDTH:-}" ] && wlr-randr --output WL-1 --custom-mode "${BL_WIDTH}x${BL_HEIGHT}" 2>&1 | sed 's/^/[wlr-randr] /' +# In debug runs, ground truth on the network from inside the session: name lookup, then a +# fetch over IPv4 and over IPv6, so a browser's "no internet" can be placed. +if [ -f "$HOME/.steamdeck-desktop-debug" ]; then + ( + echo "[net] getent: $(getent hosts example.com 2>&1 | head -2 | tr '\n' ' ')" + for f in 4 6; do + echo "[net] curl -$f: $(curl -$f -sS -m 8 -o /dev/null -w '%{http_code} %{remote_ip}' https://example.com 2>&1)" + done + ) & +fi swaybg -m fill -i /usr/share/backgrounds/steamdeck.png & # Desktop icons (pcmanfm-qt manages the desktop surface) and the panel with the app menu. run pcmanfm-qt pcmanfm-qt --desktop --profile lxqt diff --git a/tools/linuxfs/desktop/firefox-steamdeck.js b/tools/linuxfs/desktop/firefox-steamdeck.js new file mode 100644 index 0000000000..d6477d56dd --- /dev/null +++ b/tools/linuxfs/desktop/firefox-steamdeck.js @@ -0,0 +1,19 @@ +// Firefox defaults for the SteamDeck desktop, staged by the app into +// /usr/lib/firefox/defaults/pref/. A user's own prefs.js still wins. + +// Firefox judges "online" by dumping the routing table over netlink, which Android denies to +// apps; seeing no default route it switches itself to Work Offline and every page fails while +// the network is fine. Let it just try. +pref("network.manage-offline-status", false); +pref("browser.offline", false); +// No user namespaces on Android kernels and a ptrace'd process tree: the process sandboxes +// have nothing to set up and only add failure modes. +pref("security.sandbox.content.level", 0); +pref("media.cubeb.sandbox", false); +pref("security.sandbox.socket.process.level", 0); +// Handheld-sized chrome, and nothing phoning home on first run. +pref("browser.shell.checkDefaultBrowser", false); +pref("datareporting.policy.dataSubmissionEnabled", false); +pref("browser.aboutwelcome.enabled", false); +pref("browser.startup.homepage", "about:blank"); +pref("layout.css.devPixelsPerPx", "1.25");