mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 05:00:24 +02:00
SteamOS's steamvr.service runs `rm -rf ~/.cache/SteamVR` on every SteamVR start, which deletes vrwebhelper's browser profile and with it the localStorage frame-controls kept its placements in, so they were lost on every SteamVR restart and reboot. steam-ui-patches: per-patch persistent state (`state = true`). The injector keeps ~/.local/state/steam-frame-nix/ui-patches/<name>.json, seeds window.__sfuiStore in a fresh page before the patch runs and writes the file (atomically, on change, name-checked, max 64 KiB) when the page calls the CDP binding __sfuiStoreSave. frame-controls v5: placements saved there (v4 localStorage copy migrated once, then removed). steam-close-button v8: "Steam hidden" saved there; a restored hidden state hides Steam once if SteamVR already shows it when the patch attaches (or first shows it before the patch sees Steam's frame). README: "Changes outside Nix" lists the directory; install.sh uninstall removes it.
12 lines
461 B
JavaScript
12 lines
461 B
JavaScript
// Reverts frame-controls/patch.js: ends a long press, closes the popup, restores
|
|
// stock control lists, removes wrappers (a wrapper wrapped by something else
|
|
// since stays inert in the chain), listeners, style and the theater Float
|
|
// actions. Keeps window.__sfuiFrameControlsState and the saved state file.
|
|
// Safe when not patched.
|
|
(() => {
|
|
const s = window.__sfuiFrameControls;
|
|
if (!s) return 'not patched';
|
|
s.teardown();
|
|
return 'unpatched';
|
|
})()
|