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

Shield Settings are not retained across sessions #1364

Closed
srirambv opened this issue Oct 1, 2018 · 11 comments · Fixed by brave/brave-core#558
Closed

Shield Settings are not retained across sessions #1364

srirambv opened this issue Oct 1, 2018 · 11 comments · Fixed by brave/brave-core#558
Assignees
Labels
bug feature/global-settings Settings at browser level independent of shields settings feature/shields The overall Shields feature in Brave. QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Yes release/blocking

Comments

@srirambv
Copy link
Contributor

srirambv commented Oct 1, 2018

Description

Global Shield Settings are not retained across sessions

Steps to Reproduce

  1. Clean profile on Beta/Dev
  2. Change Default Global Shields settings for Adblocker/Cookie/Fingerprint
  3. Close browser window and relaunch, all settings reverts back to default values

Actual result:

Global Shield Settings are not retained across sessions

Expected result:

Global shield settings should be retained if changed from default value

Reproduces how often:

Easy

Brave version (chrome://version info)

Brave 0.55.10 Chromium: 70.0.3538.22 (Official Build) beta (64-bit)
Revision ac9418ba9c3bd7f6baaffa0b055dfe147e0f8364-refs/branch-heads/3538@{#468}
OS Windows

Reproducible on current release:

No. B-l retains the settings once its changed

Website problems only:

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

Additional Information

Multiple reports on community
cc: @simonhong @bbondy

@srirambv srirambv added bug feature/shields The overall Shields feature in Brave. release/blocking feature/global-settings Settings at browser level independent of shields settings labels Oct 1, 2018
@srirambv srirambv added this to the Releasable builds 0.55.x milestone Oct 1, 2018
@bbondy bbondy changed the title Global Shield Settings are not retained across sessions Shield Settings are not retained across sessions Oct 2, 2018
@bbondy
Copy link
Member

bbondy commented Oct 2, 2018

This is also reproducing with just Brave shield settings. I think it regressed with brave/brave-core@28e1ef0

@yrliou
Copy link
Member

yrliou commented Oct 2, 2018

Thought they're not needed since we don't use ContentSettingsStore anymore, I'll check it.

@yrliou yrliou self-assigned this Oct 2, 2018
@simonhong
Copy link
Member

Should we consider similar fixes done by BraveContentSettingsStore to HostContentSettingsMap?
default shields and brave shields api all uses HostContentSettingsMap instead of ContentSettingsStore to store configuration.

@rebron rebron assigned bbondy and unassigned yrliou Oct 2, 2018
@simonhong
Copy link
Member

Only script setting is persisted.

@bbondy
Copy link
Member

bbondy commented Oct 3, 2018

Should we consider similar fixes done by BraveContentSettingsStore to HostContentSettingsMap?

yes.

@simonhong simonhong self-assigned this Oct 3, 2018
@simonhong
Copy link
Member

simonhong commented Oct 3, 2018

Below test is failed. It seems plugin type isn't persisted.
However, javascript type is persisted.
Curious this is upstream bug or intended behavior.
Need more debugging...

IN_PROC_BROWSER_TEST_F(BraveShieldsAPIBrowserTest,
                       PRE_ShieldSettingsPersistTest) {
  HostContentSettingsMapFactory::GetForProfile(browser()->profile())->
      SetContentSettingCustomScope(
        ContentSettingsPattern::Wildcard(),
        ContentSettingsPattern::Wildcard(),
        CONTENT_SETTINGS_TYPE_PLUGINS,
        brave_shields::kHTTPUpgradableResources,
        CONTENT_SETTING_ALLOW);

  ContentSetting setting =
      HostContentSettingsMapFactory::GetForProfile(browser()->profile())->
          GetContentSetting(GURL(), GURL(), CONTENT_SETTINGS_TYPE_PLUGINS,
                            brave_shields::kHTTPUpgradableResources);
  EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
}

IN_PROC_BROWSER_TEST_F(BraveShieldsAPIBrowserTest,
                       ShieldSettingsPersistTest) {
  ContentSetting setting =
      HostContentSettingsMapFactory::GetForProfile(browser()->profile())->
          GetContentSetting(GURL(), GURL(), CONTENT_SETTINGS_TYPE_PLUGINS,
                            brave_shields::kHTTPUpgradableResources);
  EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
}

@simonhong
Copy link
Member

simonhong commented Oct 3, 2018

plugin type isn't persisted by default.
Chromium determines this configuration by their plugin strategy.
When PERSISTENT is used, this issue is fixed.
However, it changes flash permission to persistent.
Can we change this from EPHEMERAL to PERSISTENT or should we need more finer control? @bbondy

  Register(
      CONTENT_SETTINGS_TYPE_PLUGINS, "plugins",
      CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, WebsiteSettingsInfo::SYNCABLE,
      WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme),
      ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK,
                    CONTENT_SETTING_ASK,
                    CONTENT_SETTING_DETECT_IMPORTANT_CONTENT),
      WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE,
      WebsiteSettingsRegistry::DESKTOP,
      ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE,
      base::FeatureList::IsEnabled(features::kEnableEphemeralFlashPermission)
          ? ContentSettingsInfo::EPHEMERAL
          : ContentSettingsInfo::PERSISTENT);

@bbondy
Copy link
Member

bbondy commented Oct 3, 2018

We want to persist except for the case with Flash, we don't want this to regress:
#241

@srirambv
Copy link
Contributor Author

Cookie and Fingerprint settings are not retained across session. Logged #1524. Needs re-verification after #1524 is fixed

@srirambv
Copy link
Contributor Author

srirambv commented Oct 18, 2018

Verification Passed on

Brave 0.55.17 Chromium: 70.0.3538.67 (Official Build) (64-bit)
Revision 9ab0cfab84ded083718d3a4ff830726efd38869f-refs/branch-heads/3538@{#1002}
OS Linux
  • Verified Fingerprint settings are retained on each startup

Verified passed on

Brave 0.55.17 Chromium: 70.0.3538.67 (Official Build) (64-bit)
Revision 9ab0cfab84ded083718d3a4ff830726efd38869f-refs/branch-heads/3538@{#1002}
OS Mac OS X
  • Verified Fingerprint settings are retained on each startup

Verification Passed on

Brave 0.55.17 Chromium: 70.0.3538.67 (Official Build) (32-bit)
Revision 9ab0cfab84ded083718d3a4ff830726efd38869f-refs/branch-heads/3538@{#1002}
OS Windows
  • Verified Fingerprint settings are retained on each startup

@markwylde
Copy link

Is it possible this has regressed?

The following steps occur in Brave "Version 0.64.76 Chromium: 74.0.3729.157 (Official Build) (64-bit)"

  1. Navigate to "brave://settings/"
  2. Scroll down to "Brave shields defaults"
  3. See "Fingerprinting protection" is set to "Block 3rd party fingerprinting"
  4. Change "Fingerprinting protection" to "Block all fingerprinting"
  5. Restart Brave
  6. Navigate to "brave://settings/"
  7. Scroll down to "Brave shields defaults"
  8. [UNEXPECTED] See "Fingerprinting protection" is set to "Block 3rd party fingerprinting"

Step 8 should have been set to "Block all fingerprinting"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature/global-settings Settings at browser level independent of shields settings feature/shields The overall Shields feature in Brave. QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Yes release/blocking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants