Fixes #2: shields stuck disabled even after BraveShieldsDisabledForUrls is removed and SlimBrave's Reset is run.
What was happening
When SlimBrave applied "Disable Brave Shields", Brave received the BraveShieldsDisabledForUrls policy and wrote the URL patterns through to the user's profile Preferences file:
"profile": {
"content_settings": { "exceptions": { "braveShields": {
"http://*,*": { "setting": 2 },
"https://*,*": { "setting": 2 }
}}}
}Removing the policy from the registry (Windows), /etc/brave/policies/managed/ (Linux), or the managed plist (macOS) did not roll those entries back. They stayed in the user profile and continued to disable shields globally — and the Brave UI correctly refused to let the user toggle shields back on, because the profile-level exception was treated as authoritative. Reset alone couldn't fix it because the override wasn't in any policy file we control.
Fix
Added repair_brave_prefs (Python) / Repair-BravePrefs (PowerShell) that scrubs the two patterns SlimBrave writes (http://*,* and https://*,*) from the profile prefs. It runs automatically on every Apply and Reset across all three platforms, so:
- Anyone who unchecks Disable Brave Shields and Applies has the leaked entries cleaned in the same step.
- Anyone with a previously-polluted profile gets fixed the next time they hit Apply or Reset.
- User-set per-site overrides (e.g. you manually disabling shields on a specific site) are preserved — only the two SlimBrave-written wildcard patterns are removed.
- Idempotent: safe to run repeatedly, no-op when nothing to clean.
- Safe against malformed or missing Preferences files.
Apply/Reset success messages now report how many leaked entries were cleaned and warn if Brave is still running (Brave's in-memory pref state can clobber the repair when it next saves to disk).
File paths the repair touches
| OS | Profile Preferences |
|---|---|
| Linux | ~/.config/BraveSoftware/Brave-Browser/Default/Preferences
|
| macOS | ~/Library/Application Support/BraveSoftware/Brave-Browser/Default/Preferences
|
| Windows | %LOCALAPPDATA%\BraveSoftware\Brave-Browser\User Data\Default\Preferences
|
Manual fix for users who can't upgrade right now
If you can't run the new release, fully close Brave, then in the Preferences file above remove the keys "http://*,*" and "https://*,*" from profile.content_settings.exceptions.braveShields. Restart Brave.
Testing
- Polluted-fixture repair (Python + PowerShell): leaked patterns removed, user-set overrides preserved
- Idempotence verified
- Malformed JSON / missing file handled cleanly
- Full apply/reset pipeline integrated and tested
Full diff: v1.4.0...v1.4.1