Create group policy options for Shields
See original GitHub issueDescription
Add group policy support for Shields (up/down). This will support individual URLs and patterns
- Added
BraveShieldsDisabledForUrls
to disable shields urls - Added
BraveShieldsEnabledForUrls
to enable shields urls
For the design, see Figma: https://www.figma.com/file/3A6F6VrxVahiZFxLr7j7FO/Desktop-Shields?node-id=2695%3A49651
Behavior notes
This is an overview of what the user should expect when the policy is set.
Behavior when DISABLED
When the site being visited matches the URL or the pattern:
- shields should be DISABLED
- when clicking shields (to open advanced panel), person should see shields disabled
- shields itself should NOT be toggleable
- the other settings will never show up because shields are down
Behavior when ENABLED
When the site being visited matches the URL or the pattern:
- shields should be ENABLED
- when clicking shields (to open advanced panel), person should see shields enabled
- shields itself should NOT be toggleable (should be grayed out)
- none of the sub-values (block ads, https upgrade, block script, block fingerprint, block cookie) should be toggleable. It should be grayed out.
Example of how to add the group policy (Windows)
- Open
regedit.exe
- Navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\
- Create the key (folders)
BraveSoftware\Brave\
if they don’t already exist
How to add the shields DISABLE policy
- Create a new key (folder)
BraveShieldsDisabledForUrls
inside the root (HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\
) - You can now add
REG_SZ
(string value) for any sites you wish to mark as disabled.
The entries need to created in a numbered fashion. Let’s say you want to add two values. You would create:
REG_SZ
value1
set tohttps://www.example.com
REG_SZ
value2
set to[*.]brave.com
This would DISABLE shields on brave.com and all subdomains. It would also DISABLE shields on https://www.example.com - but NOT on other subdomains (or if you leave www.
out for example).
How to add the shields ENABLE policy
- Create a new key (folder)
BraveShieldsEnabledForUrls
inside the root (HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\
) - You can now add
REG_SZ
(string value) for any sites you wish to mark as enabled.
The entries need to created in a numbered fashion. Let’s say you want to add two values. You would create:
REG_SZ
value1
set to[*.]twitter.com
REG_SZ
value2
set tohttps://www.example.com
This would ENABLE shields on brave.com and all subdomains. It would also ENABLE shields on https://www.example.com - but NOT on other subdomains (or if you leave www.
out for example).
Adding using a .reg
file (also on Windows)
- Create a new empty file called
shields-policy.reg
- Open it in Notepad and put this for the content:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\BraveShieldsEnabledForUrls]
"1"="[*.]twitter.com"
"2"="https://www.example.com"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\BraveShieldsDisabledForUrls]
"1"="https://www.example.com"
"2"="[*.]brave.com"
- Save the file and close it
- Double click the
shields-policy.reg
file - You can use
regedit.exe
to confirm it was added
Test plan
Go through above - download/run the registry key. Verify that
- install is showing as managed (in hamburger menu)
- behavior matches expected behavior above
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
thanks @bsclifton!
This is available on macOS and Linux - but I’m not sure offhand how to test actually. Let me dig in on that and then I’ll share an update