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

Fix for 23919 fingerprint for language #14398

Merged
merged 3 commits into from
Aug 9, 2022

Conversation

sujitacharya2005
Copy link
Contributor

@sujitacharya2005 sujitacharya2005 commented Jul 29, 2022

Resolves brave/brave-browser#23919

Related PRs
brave/brave-browser#23306

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Currently by default this feature is off.
To enable this

  1. Go to brave://flags/
  2. Then enable brave-reduce-language

fingerPrintLanguage

@sujitacharya2005 sujitacharya2005 added CI/skip-linux CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS labels Jul 29, 2022
@github-actions github-actions bot added the potential-layer-violation-fixes This PR touches a BUILD.gn file with check_includes=false label Jul 29, 2022
@@ -187,6 +189,9 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
(BraveDialogPreference) findPreference(PREF_FINGERPRINTING_PROTECTION);
mFingerprintingProtectionPref.setOnPreferenceChangeListener(this);

mFingerprntLanguagePref = (ChromeSwitchPreference) findPreference(PREF_FINGERPRINT_LANGUAGE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sujitacharya2005 how are you syncing the pref value here ? So after changing the value, how you are checking the value and setting the pref value here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deeppandya

  1. From SwitchPreference when change value onPreferenceChange will call , there updating UserPrefs.

  2. in feature.cc it's set initial value disabled
    const base::Feature kBraveReduceLanguage{"BraveReduceLanguage",
    base::FEATURE_DISABLED_BY_DEFAULT};

  3. From UI side also initial value SwitchPreference is false
    <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
    android:defaultValue="false" />

  4. Now I need to verify that UserPrefs setting in native code happening properly
    UserPrefs.get(Profile.getLastUsedRegularProfile())
    .setBoolean(BravePref.REDUCE_LANGUAGE_ENABLED, (boolean) newValue);

  5. My understanding like once setting this UserPrefs value automatically native will take care the feature
    so I am not doing any syncing logic.
    Please let me know if anything I am missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deeppandya
Updated initial UI SwitchPreference state based on native value.

@sujitacharya2005 sujitacharya2005 added this to the 1.44.x - Nightly milestone Jul 29, 2022
@sujitacharya2005 sujitacharya2005 force-pushed the FIX_for_23919_fingerprinting_for_language branch from 70c2c0d to d5326c1 Compare August 2, 2022 16:08
Copy link
Contributor

@deeppandya deeppandya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sujitacharya2005 sujitacharya2005 force-pushed the FIX_for_23919_fingerprinting_for_language branch from d5326c1 to d9759ae Compare August 9, 2022 11:44
@sujitacharya2005 sujitacharya2005 merged commit 009d932 into master Aug 9, 2022
@sujitacharya2005 sujitacharya2005 deleted the FIX_for_23919_fingerprinting_for_language branch August 9, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64 potential-layer-violation-fixes This PR touches a BUILD.gn file with check_includes=false
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option for Prevent sites from fingerprinting me based on my language preferences
2 participants