Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a policy option to disable Brave Rewards #25151

Closed
mkarolin opened this issue Sep 1, 2022 · 6 comments · Fixed by brave/brave-core#14928
Closed

Add a policy option to disable Brave Rewards #25151

mkarolin opened this issue Sep 1, 2022 · 6 comments · Fixed by brave/brave-core#14928

Comments

@mkarolin
Copy link
Contributor

mkarolin commented Sep 1, 2022

This is a sub-task for #22029

Test Plan:

  1. Set the policy to disable Brave Rewards:
  • [Linux]
    (sudo is needed in this step) Go to /etc/brave/policies/managed (create folders if not exists already), create test_policy.json with content:
{
  "BraveRewardsDisabled": true
}
  • [Windows]
    Open regedit and create the following keys: BraveSoftware\Brave under the existing key

    • For 64 bit, HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Policies
    • For 32 bit, HKEY_LOCAL_MACHINE\SOFTWARE\Policies

    Create a DWORD value at this path called BraveRewardsDisabled and set the value as 1

  • [MacOS]

    • Create folder /Library/Managed Preferences/<username>/, if one doesn't exist (you will need to use sudo)
    • In the above folder create (or open; you will need to use sudo) the file named com.brave.Browser.<CHANNEL>.plist (where <CHANNEL> will be nightly, beta, or nothing for the release channel: e.g com.brave.Browser.nightly.plist) with the content
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <plist version="1.0">
       <dict>
         <key>BraveRewardsDisabled</key>
         <true/>
       </dict>
      </plist>
      

    Note: MacOS caches these preferences, so if you delete or rename this file and restart the browser it will still retain this policy. In order to reset the policy quit the browser fully, delete or rename the file and issue to following command:

    defaults read /Library/Managed\ Preferences/<username>/com.brave.Browser.<CHANNEL>.plist
    

    You should see output similar to:

    2022-09-28 18:46:43.413 defaults[10710:143731] 
    Domain /Library/Managed Preferences/<username>/com.brave.Browser.nightly.plist does not exist
    

    Start the browser and you should be able to see the Rewards feature again.

  1. Open Brave and navigate to brave://policy. Observe:

Policy

  1. Observe Brave Rewards icon is not shown in the location bar
  2. Navigate to brave://rewards. Observe This site can’t be reached error page.
  3. Navigate to brave://rewards-internals. Observe This site can’t be reached error page.
  4. Open application menu (☰). Observe Brave Rewards menu item is not present
  5. Navigate to brave://settings. Observe:
    • Brave Rewards item is not present in the top Settings toolbar
    • Brave Rewards item is not present in the left navigation menu
    • In the Shields section the sentence This will block most ads on websites, not Brave Private Ads — those are controlled in the Brave Rewards settings. is replaced with This will block most ads on websites.
  6. Open application menu -> More Tools -> Task Manager. Observe Extension: Brave Rewards is not present (note that you would need to disable #brave-rewards-webui-panel flag to have the extension loaded normally).
@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Sep 29, 2022

Verification PASSED on

Brave | 1.45.78 Chromium: 106.0.5249.65 (Official Build) beta (64-bit)
-- | --
Revision | 3269dc3633cdd2ab94546fdbe54962e45b17a6e0-refs/branch-heads/5249@{#580}
OS | Windows 10 Version 21H2 (Build 19044.2006)

Ensured that (step 3) the Brave rewards icon is NOT shown in the URL bar
image

Ensured that (step 4) the This site can’t be reached error page is shown when brave://rewards page is opened
image

Ensured that (step 5) the This site can’t be reached error page is shown when brave://rewards-internals page is opened
image

Ensured that (step 6) the Brave Rewards menu option is NOT present in the hamburger menu
image

Ensured that (step 7a) the Brave Rewards header menu is NOT shown in the top header navigation bar in brave://settings
image

Ensured that (step 7b) the Brave Rewards left navigation menu is NOT shown in the left navigation settings bar in brave://settings page
image

Ensured that (step 7c) the Shields section the sentence This will block most ads on websites, not Brave Private Ads — those are controlled in the Brave Rewards settings. is replaced with This will block most ads on websites.
image

Ensured that (step 8) the Extension: Brave Rewards is not present in application menu -> More Tools -> Task Manager
image

Steps followed to verify the 2nd part from step 8 (note that you would need to disable #brave-rewards-webui-panel flag to have the extension loaded normally)

  • Close the browser
  • Remove/delete the BraveRewardsDisabled key from HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Policies\BraveSoftware\Brave
  • Relaunch the browser
  • Open brave://flags and disable #brave-rewards-webui-panel flag and relaunch the browser
  • Click on Brave rewards icon the URL bar
  • Open application menu -> More Tools -> Task Manager and ensured Extension: Brave Rewards is loaded

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Sep 29, 2022

@mkarolin I have added the key in the REGEDIT as mentioned in the step 2 in the above test plan, after that when I open the brave://rewards I am not seeing the This site can’t be reached error page. Could you look into this and let me know If I'm missing anything here?
image

@GeetaSarvadnya GeetaSarvadnya added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Sep 29, 2022
@mkarolin
Copy link
Contributor Author

mkarolin commented Sep 29, 2022

@mkarolin I have added the key in the REGEDIT as mentioned in the step 2 in the above test plan, after that when I open the brave://rewards I am not seeing the This site can’t be reached error page. Could you look into this and let me know If I'm missing anything here?

@GeetaSarvadnya, instead of creating QWORD (64-bit) value in the registry, please, create a DWORD (32-bit) value.

@GeetaSarvadnya
Copy link

@mkarolin Thanks. It's working as expected now.

@GeetaSarvadnya GeetaSarvadnya added QA Pass-Win64 and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Sep 29, 2022
@LaurenWags
Copy link
Member

LaurenWags commented Oct 4, 2022

Verified with

Brave | 1.45.85 Chromium: 106.0.5249.91 (Official Build) beta (x86_64)
-- | --
Revision | fa96d5f07b1177d1bf5009f647a5b8c629762157-refs/branch-heads/5249@{#707}
OS | macOS Version 12.6 (Build 21G115)

Verified the test plan from #25151 (comment):

  • Confirmed BraveRewardsDisabled shown on brave://policy page
  • Confirmed Brave Rewards icon not shown in URL bar
  • Confirmed brave://rewards displays This site can’t be reached error page
  • Confirmed brave://rewards-internals displays This site can’t be reached error page
  • Confirmed under the application menu (☰) Brave Rewards menu item is not present
  • Confirmed under brave://settings:
    • Brave Rewards item is not present in the top Settings toolbar
    • Brave Rewards item is not present in the left navigation menu
    • In the Shields section the sentence This will block most ads on websites, not Brave Private Ads — those are controlled in the Brave Rewards settings. is replaced with This will block most ads on websites.
  • Confirmed Extension: Brave Rewards is not present in the Task Manager ( under application menu -> More Tools -> Task Manager)
Step 2 & 3 Step 4 Step 5 Step 6 Step 7 Step 7 Step 8
step2and3 4 5 6 7a 7b 8

Other items checked:

  • Confirmed no "Rewards" card on NTP
  • Confirmed no mention of "Rewards" card on "Customize Dashboard" options
Example Example
Screen Shot 2022-10-05 at 10 03 17 AM Screen Shot 2022-10-05 at 10 05 09 AM
  • Confirmed no in-line tip buttons for Reddit, GitHub, Twitter
Example Example Example
Screen Shot 2022-10-05 at 1 11 38 PM Screen Shot 2022-10-05 at 1 11 54 PM Screen Shot 2022-10-05 at 1 12 27 PM

Logged the below follow up issues:
#25799 - "Chrome Policies" should be "Brave Policies"
#25800 - policy name should direct to Brave specific documentation, not general Google/Chrome documentation
#25807 - Update branding on brave://management page
#25812 - "Start using Rewards" button is available on "Customize Dashboard" settings under Background Images

@btlechowski
Copy link

Verification passed on

Brave 1.45.90 Chromium: 106.0.5249.103 (Official Build) beta (64-bit)
Revision 182570408a1f25ab2731ef5f283b918df9b9f956-refs/branch-heads/5249_91@{#6}
OS Ubuntu 18.04 LTS

Ensured that (step 3) the Brave rewards icon is NOT shown in the URL bar
image

Ensured that (step 4) the This site can’t be reached error page is shown when brave://rewards page is opened
image

Ensured that (step 5) the This site can’t be reached error page is shown when brave://rewards-internals page is opened
image

Ensured that (step 6) the Brave Rewards menu option is NOT present in the hamburger menu
image

Ensured that (step 7a) the Brave Rewards header menu is NOT shown in the top header navigation bar in brave://settings
image

Ensured that (step 7b) the Brave Rewards left navigation menu is NOT shown in the left navigation settings bar in brave://settings page
image

Ensured that (step 7c) the Shields section the sentence This will block most ads on websites, not Brave Private Ads — those are controlled in the Brave Rewards settings. is replaced with This will block most ads on websites.
image

Ensured that (step 8) the Extension: Brave Rewards is not present in application menu -> More Tools -> Task Manager
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment