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

Greaselion doesn't respect twitter-tips-enabled precondition #11664

Closed
emerick opened this issue Sep 10, 2020 · 2 comments · Fixed by brave/brave-core#6625
Closed

Greaselion doesn't respect twitter-tips-enabled precondition #11664

emerick opened this issue Sep 10, 2020 · 2 comments · Fixed by brave/brave-core#6625

Comments

@emerick
Copy link
Contributor

emerick commented Sep 10, 2020

Description

Greaselion doesn't respect the twitter-tips-enabled precondition.

Steps to Reproduce

Create a Greaselion.json file like this:

[
  {
    "urls": [
      "https://twitter.com/*",
      "https://*.twitter.com/*"
    ],
    "scripts": [
      "scripts/brave_rewards/publisher/twitter/twitter.bundle.js"
    ],
    "preconditions": {
      "twitter-tips-enabled": true
    }
  }
]
  1. Launch browser with a clean profile
  2. Enable Rewards
  3. Disable Twitter tipping in Rewards settings
  4. Relaunch browser
  5. Visit site that matches Greaselion rule with precondition

Actual result:

Greaselion script runs even though Twitter tips is disabled.

Expected result:

Greaselion script shouldn't run, since twitter-tips-enabled precondition hasn't been satisfied.

Reproduces how often:

Every time

Brave version (brave://version info)

Version/Channel Information:

  • Can you reproduce this issue with the current release?
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
  • Does the issue resolve itself when disabling Brave Rewards?
  • Is the issue reproducible on the latest version of Chrome?

Miscellaneous Information:

@emerick
Copy link
Contributor Author

emerick commented Sep 10, 2020

Seems like this code enables/disables the rewards-enabled and twitter-tips-enabled preconditions as a unit even though they're separate settings:

void RewardsServiceImpl::EnableGreaseLion(const bool enabled) {
  #if BUILDFLAG(ENABLE_GREASELION)
    if (greaselion_service_) {
      greaselion_service_->SetFeatureEnabled(greaselion::REWARDS, enabled);
      greaselion_service_->SetFeatureEnabled(greaselion::TWITTER_TIPS, enabled);
    }
  #endif
}

cc: @pilgrim-brave

@NejcZdovc NejcZdovc self-assigned this Sep 11, 2020
@srirambv srirambv changed the title Greaselion doesn't respect twitter-tips-enabled precondition [desktop] Greaselion doesn't respect twitter-tips-enabled precondition Sep 11, 2020
@srirambv srirambv changed the title [desktop] Greaselion doesn't respect twitter-tips-enabled precondition [Desktop] Greaselion doesn't respect twitter-tips-enabled precondition Sep 11, 2020
@NejcZdovc NejcZdovc added this to the 1.16.x - Nightly milestone Sep 11, 2020
@LaurenWags
Copy link
Member

Per internal discussions, this issue should be tested when Twitter tipping with Greaselion lands (projected to be 1.17.x). As such, I have logged a follow up issue (#11997) for that milestone and will be marking this one as QA/No and release-notes/exclude. Please adjust if needed.

@rebron rebron changed the title [Desktop] Greaselion doesn't respect twitter-tips-enabled precondition Greaselion doesn't respect twitter-tips-enabled precondition Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants