RES-Slim v0.3.8 — settingsNavigation click handler and URL parser fixes
Five real bug fixes to settingsNavigation. These were sitting uncommitted in the working tree (work-in-progress from a prior session) and got triaged as part of the v0.3.7 audit cycle — the four original fixes are solid, plus one additional regression I caught during verification.
Fixed
Click interceptor
-
Modifier clicks — the click handler previously only respected
ctrlKey, so cmd-click (macOS), shift-click, and alt-click on a settings link would still intercept and open the console instead of honoring the modifier's native behavior (open in new tab, etc.). Now checks all four modifier keys. -
Nested click targets — the old check
e.target instanceof HTMLAnchorElementbroke if the user clicked an icon or span inside a settings link. Now walks up viae.target.closest('a'). -
target="_blank"anchors — the interceptor now skips anchors that explicitly opt into a new tab. Previously those got hijacked into the embedded console.
parseHash / makeUrlHash
-
Proper URL encoding — the old code used a regex match + literal
%20string replace, which only handled spaces and broke on any other URL-encoded character. Now usesencodeURIComponent/decodeURIComponentfor a proper round-trip. Also internally normalizes the legacy#!settingsprefix so both old and new links parse to the same result. -
Prefix match vs substring match — [caught during verification against the existing test URLs]. The initial fix sliced the hash at position 14 (length of
#res:settings), so a URL like#res:settings-redirect-standalone-options-page/accountSwitcher(a distinct test-harness route that happens to share#res:settingsas a literal prefix) was getting parsed with-redirect-standalone-options-pageas the moduleID. Fixed by requiring the prefix to be followed by/or end-of-string before treating the remainder as a path.
Verified with
Edge-case test harness in a node one-liner:
"#res:settings" => {}
"#res:settings/" => {}
"#res:settings/commentHighlights" => {"moduleID":"commentHighlights"}
"#res:settings/commentHighlights/color" => {"moduleID":"commentHighlights","optionKey":"color"}
"#res:settings/commentHighlights/expire%20days" => {"moduleID":"commentHighlights","optionKey":"expire days"}
"#!settings/autoExpand" => {"moduleID":"autoExpand"}
"#!settings" => {}
"#something-else" => {}
"" => {}
"#res:settings-redirect-standalone-options-page/accountSwitcher" => {}
All cases return the expected result — URL encoding round-trips (expire%20days → expire days), both hash styles parse, and the prefix-substring trap returns empty instead of a bogus moduleID.
Not shipped in this release
The tests/settingsConsole.js diff is still uncommitted. It's a mechanical selector refresh (#moduleOptionsSave → #RESGlobalSave, workspaceStageStatus → RESGlobalStageBar, .optionsSaved → .is-saved) plus two new tests — but it references upstream RES modules (accountSwitcher, keepLoggedIn, quickMessage, wheelBrowse) that were stripped from RES-Slim in v0.1.0. Shipping the selector sync on tests that can't actually run against this private fork would just propagate stale fixtures. Those tests need a separate rewrite against modules that actually exist in RES-Slim; out of scope for a bug-fix release. There's also no CI wiring, so they're never executed regardless.
Install
CRX (signed, auto-updates from prior RES-Slim CRX installs — same extension ID)
Download res-slim-chrome-v0.3.8.crx and drag into chrome://extensions with Developer mode enabled.
Zip (unpacked)
Download RES-Slim-v0.3.8-chrome.zip, extract, and load unpacked from chrome://extensions.
Verification
yarn oncecleanyarn eslint lib/modules/settingsNavigation.jscleanyarn stylelintcleannpx flow check: 0 errors