Brave-browser: Rewards extension process needs to be terminated when disabled, Follow up to #1475

Created on 21 Feb 2019  路  17Comments  路  Source: brave/brave-browser

Description


Based on #1475, it only hides the extension from UI but the background process continues to run which is waste of resources. When the extension is hidden from UI corresponding extension process needs to be terminated/killed off to conserve resources

Steps to Reproduce

  1. Disable rewards from UI
  2. Open Browser Task manager
  3. Still shows extension process running even though its hidden

Actual result:


screenshot from 2019-02-21 08-00-12

Expected result:

Should terminate the process when extension is hidden from UI

Reproduces how often:


Easy

Brave version (brave://version info)

Brave | 0.61.34 Chromium: 73.0.3683.39聽(Official Build)聽beta(64-bit)
-- | --
Revision | cc53b0e12fcaf42e4bab8d6c23bd4fb7aae99f6c-refs/branch-heads/3683@{#413}
OS | Linux

Reproducible on current release:

  • Does it reproduce on brave-browser dev/beta builds?
    Yes

    Website problems only:

  • Does the issue resolve itself when disabling Brave Shields?

  • Is the issue reproducible on the latest version of Chrome?

Additional Information

QA Pass-Linux QA Pass-Win64 QA Pass-macOS QTest-Plan-Specified QYes featurextensions featurrewards release-noteinclude suggestion

Most helpful comment

Brave is getting a hard pass from me until this is resolved. Wasting resources on something that is claimed to "do nothing" is incredibly shady.

All 17 comments

Because of this tiny icon Brave is a goner for me.

Brave is getting a hard pass from me until this is resolved. Wasting resources on something that is claimed to "do nothing" is incredibly shady.

Shouldn't disabling rewards also terminate the Bat Ledger Service?

The rewards extension can be manually disabled for now with the command line argument --disable-brave-rewards-extension, but the Bat Ledger Service cannot be so easily disabled yet.

I think a patch like this would work- but you'd need to restart the browser if you wanted to either stop the process now or re-enable rewards

diff --git a/browser/extensions/brave_component_loader.cc b/browser/extensions/brave_component_loader.cc
index 11f0ab83a..19b499715 100644
--- a/browser/extensions/brave_component_loader.cc
+++ b/browser/extensions/brave_component_loader.cc
@@ -108,7 +108,8 @@ void BraveComponentLoader::AddDefaultComponentExtensions(
   }

 #if BUILDFLAG(BRAVE_REWARDS_ENABLED)
-  if (!command_line.HasSwitch(switches::kDisableBraveRewardsExtension)) {
+  if (!profile_prefs_->GetBoolean(kHideBraveRewardsButton) &&
+    !command_line.HasSwitch(switches::kDisableBraveRewardsExtension)) {
     base::FilePath brave_rewards_path(FILE_PATH_LITERAL(""));
     brave_rewards_path =
         brave_rewards_path.Append(FILE_PATH_LITERAL("brave_rewards"));

@bsclifton I think @gabrielhug also want to prevent launching Bat Ledger Service.
For now, I think we don't have command line switch for that.
Disabling brave rewards is needed to prevent extension and utility service process.(https://github.com/brave/brave-browser/issues/1475#issuecomment-471380598)

What is the current status of this issue?

+1 from @foamz via #4659

+1 from @bughit via #4612

The problem is "persistent": true in the manifest. The extension (which is just UI and does nothing without the actual service running) is always enabled to show the brave rewards icon, but there is no reason for the background page to be persistent. We should probably have an advanced option to completely disable the extension and remove the rewards icon, but without the background page running the only impact is the extension icon in the urlbar

a non persistent background page is also better for resource usage when rewards is enabled

Any updates on this? I'm losing ~200 MB to stuff I don't use.

As a user with 4 gigs of RAM, those ~200MBs are really precious to me.
+1

I'm on Brave Nightly 0.73.26 and still see Brave Rewards and Bat Ledger Service eating memory in task manager of brave. I made sure that I disabled rewards in settings and restarted brave.

@ilyaigpetrov looking at master:
https://github.com/brave/brave-core/commits/master

Doesn't seem there's been a version published (yet) which has this fix. You can either hang tight until a new one goes public (should happen tomorrow) or you can download the latest non-published Nightly here:
https://github.com/brave/brave-browser/releases/tag/v0.73.31

Verified passed with

Brave | 0.71.105 Chromium: 78.0.3904.70聽(Official Build)聽beta聽(64-bit)
-- | --
Revision | edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}
OS | macOS Version 10.13.6 (Build 17G5019)

  • Confirmed STR from description. Note, Bat Ledger Service and Bat Ads Service are still running in the background without Rewards enabled. This is logged with #5429
  • Verified test plan from https://github.com/brave/brave-core/pull/3698
    Test plan 1 (single profile) before clicking on BAT logo - Brave Rewards extension is not running:
    1-before clicking on BAT logo
    After clicking on BAT logo:
    1-after clicking on BAT logo

Test plan 2 (single profile) upgraded profile with BR already on/opt-ed in:
2

  • Confirmed test plans 1&2 work as expected when a second profile is added.

Verification passed on

Brave | 0.71.105 Chromium: 78.0.3904.70聽(Official Build)聽beta聽(64-bit)
-- | --
Revision | edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}
OS | Ubuntu 18.04 LTS

Encountered #5429, https://github.com/brave/brave-browser/issues/6663

Verified upgrade profile and multi profile
image

Verification passed on

Brave | 0.71.106 Chromium: 78.0.3904.70聽(Official Build)聽beta聽(64-bit)
-- | --
Revision | edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}
OS | Windows聽10 OS Version 1803 (Build 17134.1006)

Test plan 1 - before clicking on rewards BAT icon, brave rewards extension is not loaded

image

Test plan 1 - After clicking on rewards BAT icon, brave rewards extension is loaded
image

  • Test plan 2 (single profile) upgraded profile with BR already on/opt-ed in:

image

  • Confirmed test plans 1&2 work as expected when a second profile is added.

image

image

Was this page helpful?
0 / 5 - 0 ratings