No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
nnra6864 b956092389 chore: Dependencies come from the ktisigonos organization
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 01:23:03 +01:00
.gitignore chore: Zig's caches and fetched packages are ignored 2026-11-10 16:09:48 +01:00
adapter.zig refactor: Code, error messages and READMEs no longer cite design numbers 2026-11-09 20:17:19 +01:00
build.zig feat: kosm_userjs reads and writes Firefox's user.js, prefs by their quoted names 2026-11-07 13:16:05 +01:00
build.zig.zon chore: Dependencies come from the ktisigonos organization 2026-11-11 01:23:03 +01:00
parser.zig refactor: Code, error messages and READMEs no longer cite design numbers 2026-11-09 20:17:19 +01:00
README.md refactor: Code, error messages and READMEs no longer cite design numbers 2026-11-09 20:17:19 +01:00
root.zig refactor: Code, error messages and READMEs no longer cite design numbers 2026-11-09 20:17:19 +01:00

kosm_userjs

Firefox's user.js for kosm: the userjs adapter reads and writes the user_pref("name", value); lines Firefox, Zen and other Firefox-based browsers read from a profile at startup, and // kosm:begin blocks in them. Apps for those browsers use it; kosm_zen writes Zen's prefs through it.

.js is JavaScript, so the adapter claims no extension: pass .lang = "userjs".

  • Paths: a pref is one key named by its whole name, so its path is quoted: prefs.set("\"zen.theme.accent-color\"", ...).
  • Values: Firefox prefs hold only a bool, a 32-bit integer or a string. Colors are written as strings (#rrggbb by default), joined values as one string. A float, or an integer outside 32 bits, is an error, never turned into a string silently: pass "1.25" yourself. Booleans are always true/false, whatever format.boolean says, since Firefox reads nothing else.
  • Reading: //, /* */ and # comments are skipped. Anything but user_pref (pref, sticky_pref, stray text) is an error naming the line.