UI patches: find Steam internals by signature, offline checker

Runtime patches no longer use webpack module ids or minified export
names, which change with every Steam UI build:

- modules/lib/finders.js: finder library (getWebpackRequire,
  findModule/findExport by source text and shape, resolveAll with a
  per-page cache, findFiberUp/findFiberDown/findInReactTree), installed
  once per page as window.__sfuiFind.
- modules/lib/signatures.json: the signatures, per patch, shared by the
  patches and the checker. lib/default.nix mkPatch wraps a patch
  `(find, sigs, opts) => ...` with the library, its signatures and
  options; exposed as steamFrame.uiPatches.lib.
- Keyboard patch (VERSION 10): layouts module, current/enabled layout
  getters, arrow keys, VR keyboard status and VirtualKeyboardManager are
  found by signature; if one doesn't match it reports which and leaves
  Steam untouched. unpatch.js uses references the patch remembered.
  The helper logs inject results when they change.
- launcher-menu launch/pinned-desktop use the library's fiber helpers;
  launch no longer depends on the bar popup's window name.
- scripts/check-signatures.mjs (+ webpack-modules.mjs): extracts module
  factories from the installed bundles without a browser and checks
  every signature (found / ambiguous / missing, with module ids and
  export names). README: "Finders and signatures", "After a Steam update".
This commit is contained in:
Pierre Kisters committed 2026-09-27 20:04:15 +02:00
1 parent dd6f3602aa
commit 6a8924f219
14 files changed
+1022 -78

No files matched your search

+15 -8
View File
@@ -13,10 +13,13 @@
# the menu stays open until the program's window appears, inviting double
# launches). Options are passed by calling the patch's function.
# All are reverted when turned off (next switch).
# Depends on Steam UI internals; tested with Steam client 1790377368.
# Depends on Steam UI internals (React props, popup names), not on webpack
# module ids; scripts/check-signatures.mjs checks them after a Steam update
# (lib/signatures.json). Tested with Steam client 1790377368.
{ config, lib, pkgs, ... }:
let
cfg = config.steamFrame.launcherMenu;
inherit (import ./lib { inherit pkgs; }) mkPatch;
sharedJSContext = { title = "SharedJSContext"; };
in {
imports = [ ./steam-ui-patches.nix ];
@@ -78,20 +81,24 @@ in {
++ lib.optional (cfg.pinDesktop != null) {
name = "launcher-menu-pinned-desktop";
target = sharedJSContext;
patch = pkgs.writeText "launcher-menu-pinned-desktop.js" ''
(${builtins.readFile ./launcher-menu/pinned-desktop/patch.js})(${builtins.toJSON { position = cfg.pinDesktop; }})
'';
patch = mkPatch {
name = "launcher-menu-pinned-desktop";
src = ./launcher-menu/pinned-desktop/patch.js;
opts.position = cfg.pinDesktop;
};
unpatch = ./launcher-menu/pinned-desktop/unpatch.js;
}
++ lib.optional (cfg.closeOnLaunch || cfg.launchDebounce > 0) {
name = "launcher-menu-launch";
target = sharedJSContext;
patch = pkgs.writeText "launcher-menu-launch.js" ''
(${builtins.readFile ./launcher-menu/launch/patch.js})(${builtins.toJSON {
patch = mkPatch {
name = "launcher-menu-launch";
src = ./launcher-menu/launch/patch.js;
opts = {
inherit (cfg) closeOnLaunch;
debounceSeconds = cfg.launchDebounce;
}})
'';
};
};
unpatch = ./launcher-menu/launch/unpatch.js;
};
}