No description
- Zig 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .gitignore | ||
| adapter.zig | ||
| build.zig | ||
| build.zig.zon | ||
| parser.zig | ||
| README.md | ||
| root.zig | ||
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 (
#rrggbbby 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 alwaystrue/false, whateverformat.booleansays, since Firefox reads nothing else. - Reading:
//,/* */and#comments are skipped. Anything butuser_pref(pref,sticky_pref, stray text) is an error naming the line.