mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 01:00:13 +02:00
Trim: firefox launcher, debugger-arm migration, comments and docs
- firefox: the prefs.js patterns built once; the extension link condition without the redundant desktopFix (it implies a pref). - install.sh steamvr-debugger-arm: no second copy of the old-marker migration (cleanup, run on every switch before the arm unit exists, already does it). - steam-ui-patches: shorter state option description; lib's description mentions extraArgs. - README: uiPatches.patches fields in the options table (moved from docs/ui-patches.md); docs/ui-patches.md: the finder helpers; docs/steamvr-debugger.md: repeated sentences removed.
This commit is contained in:
1 parent
a5ecbad76d
commit
b3d93e8526
8 files changed
+43
-69
No files matched your search
@@ -44,12 +44,6 @@ Port: `VRWebHelper/DebuggerPort`, default 8087.
|
||||
- when SteamVR stops, the key goes back to its previous value (removed if
|
||||
it wasn't there) and `.armed` is removed.
|
||||
|
||||
The runtime files don't need Nix, which is why rollback and uninstall are
|
||||
covered; they are gone at reboot, and `.armed` (the only trace after a
|
||||
power loss) is resolved by the next SteamVR start or
|
||||
`steam-frame-nix-cleanup`. Disabled, there is no unit; the switch (cleanup)
|
||||
restores the key if SteamVR is stopped, otherwise the runtime drop-in does
|
||||
when it stops.
|
||||
|
||||
Until SteamVR has been restarted once with the drop-in, the port is closed
|
||||
and `steam-ui-patches` keeps polling it.
|
||||
The runtime files need no Nix (rollback, uninstall) and are gone at reboot;
|
||||
`.armed`, the only trace after a power loss, is resolved by the next
|
||||
SteamVR start or `steam-frame-nix-cleanup`.
|
||||
+10
-17
@@ -65,16 +65,8 @@ it runs. What they have in common:
|
||||
|
||||
## Defining a patch
|
||||
|
||||
`steamFrame.uiPatches.patches` entries:
|
||||
|
||||
| Attribute | Default | Description |
|
||||
|---|---|---|
|
||||
| `name` | | Unique name (log). |
|
||||
| `endpoint` | `"http://127.0.0.1:8080"` | DevTools base URL; `/json/list` is polled every 5 s. |
|
||||
| `target.title` / `target.titleRegex` / `target.urlRegex` | `null` | Pages to patch; all given criteria must match (JS regexes). |
|
||||
| `patch` | | JS file evaluated in every matching page (awaited). |
|
||||
| `unpatch` | `null` | JS file evaluated when the service stops. |
|
||||
| `state` | `false` | Give the patch one [persistent JSON value](#persistent-state). |
|
||||
A `steamFrame.uiPatches.patches` entry (fields:
|
||||
[README, Options](../README.md#options)):
|
||||
|
||||
```nix
|
||||
steamFrame.uiPatches.patches = [ {
|
||||
@@ -128,9 +120,11 @@ patches never use them. `modules/lib/finders.js` (like Decky Loader's
|
||||
`findInReactTree`).
|
||||
|
||||
Every signature must match exactly once, otherwise the patch changes nothing
|
||||
and reports it (e.g. `signature not found, Steam left unpatched:
|
||||
layouts.currentLayout (module 40222): ambiguous export, candidates r_, xy`).
|
||||
Results are cached per page.
|
||||
and reports it: `resolvePatch` returns e.g. `signature not found, Steam left
|
||||
unpatched: layouts.currentLayout (module 40222): ambiguous export,
|
||||
candidates r_, xy` as the patch's result. Results are cached per page. The
|
||||
library also has `ensureStyle(doc, id, css)` and `logger(buffer)` (a capped
|
||||
debug log).
|
||||
|
||||
Signatures live in `modules/lib/signatures.json`, shared by patches and the
|
||||
offline checker. An entry can also list `expects` (strings the patch relies
|
||||
@@ -164,10 +158,9 @@ steamFrame.uiPatches.patches = [ {
|
||||
|
||||
```js
|
||||
((find, sigs, opts, hooks) => {
|
||||
let mods;
|
||||
try { mods = find.resolveAll(find.getWebpackRequire('webpackChunksteamui'), sigs); }
|
||||
catch (e) { return `not patched: ${e.message}`; }
|
||||
const Thing = mods.thing.exports.Thing; // SteamVR dashboard: 'webpackChunkvrwebui'
|
||||
const mods = find.resolvePatch('webpackChunksteamui', sigs); // SteamVR dashboard: 'webpackChunkvrwebui'
|
||||
if (typeof mods === 'string') return mods; // signature not found
|
||||
const Thing = mods.thing.exports.Thing;
|
||||
…
|
||||
})
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user