Two community-contributed macOS improvements, plus the multi-channel detection plumbing that backs them on Linux. No Windows changes — SlimBrave.ps1 is byte-identical to v1.4.2.
Both features are courtesy of @zhaoJianNet — thank you.
macOS
Multi-channel support (PR #5)
Every Brave channel ships its own bundle ID and Managed Preferences plist (com.brave.Browser, .beta, .nightly, .dev). SlimBrave previously hardcoded the Stable plist, so users with Beta or Nightly installed got no policy applied to those channels.
detect_brave() now returns one installation record per detected channel and apply_policy / reset_policy / repair_brave_prefs iterate across the selected channels — each gets its own plist write.
New --channels CLI flag (default auto = all detected):
sudo python3 slimbrave-mac.py --import preset.json --channels stable,betaConfiguration Profile persistence (PR #7, fixes #6)
On macOS 13+ Apple Silicon, cfprefsd/mdmclient can clear directly-written /Library/Managed Preferences/*.plist files at reboot when no Configuration Profile backs them — so policies didn't persist for several users. Apple's documented path for durable managed preferences without an MDM is to install a real Configuration Profile.
New --persist on mode generates a .mobileconfig (validated with plutil -lint) and opens System Settings → General → Device Management for the one-time GUI install. Policies then survive reboots. --persist off keeps the existing plist-only behaviour. When the flag is omitted, the mode currently installed is reused, so a re-run never silently downgrades.
sudo python3 slimbrave-mac.py --import preset.json --persist on
sudo python3 slimbrave-mac.py --reset # cleans up profile + plist + leaked prefs in one passEnd-to-end verified on Apple Silicon by @zhaoJianNet and confirmed working by @ethanynahte.
Apply-time prompts
Channel selection and persistence mode have moved out of the main TUI list into Apply-time prompts. The main list stays focused on policy toggles; clicking Apply asks the macOS-only questions in order, both sticky to whatever's currently installed (Enter keeps current). Single-channel users skip the channel prompt automatically.
Linux
The detection/repair refactor that backs PR #5 extends to Linux: repair_brave_prefs and process-running detection now iterate over each detected channel's ~/.config/BraveSoftware/<dir>/ and binary name. Policy targets are unchanged — brave-core hardcodes /etc/brave/policies for every channel, so a single policy file still applies to all of them and no channel selector is needed.
Behavior preserved for single-channel users (the dominant case):
| Check | Result |
|---|---|
| Preset round-trip (all 5) | unchanged |
| Legacy array import (Parental Controls fix) | unchanged |
| Group exclusivity (Incognito Disable/Force) | unchanged |
| DNS custom-without-template validation | unchanged |
apply_policy with default args
| auto-detects + writes same JSON shape to /etc/brave/policies/managed/slimbrave.json
|
| Single-channel repair on polluted fixture | wildcards removed, user-set per-site override preserved |
Windows
SlimBrave.ps1 is byte-identical to v1.4.2 — these PRs only touched the Python scripts.
Full diff: v1.4.2...v1.5.0