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

Hide DDG option from Private/Tor new tab if default search is overridden #1632

Closed
bsclifton opened this issue Oct 16, 2018 · 2 comments · Fixed by brave/brave-core#657
Closed

Comments

@bsclifton
Copy link
Member

bsclifton commented Oct 16, 2018

Test plan

  1. Fresh install of Brave (ex: move your profile folder out of the way)
  2. Set your region to France or Germany
  3. Launch Brave
  4. Verify your default search engine is set to Qwant
  5. Open a new private window and verify DDG is not shown
  6. Open a new Tor window and verify DDG is not shown
  7. Repeat steps 2-6 for the other country

Description

Related to #1607

The above issue has a fix implemented with brave/brave-core#654

However, this is checking navigator.language in the JavaScript code instead of:

  • checking the country (ex: if country should override search engine)
    OR
  • checking if the country was already overridden (when profile was created)

And exposing this to the webUI code. This could potentially be set as a new profile preference in src/components/search_engines/template_url_prepopulate_data.cc; for example:

  • New user installs Brave
  • User is in Germany
  • Qwant is chosen as default search engine
  • We could set a new preference: prefs->SetInteger(prefs::kSearchOverridden, 1);
  • If search ever gets changed by the user (manually), we can set this value to 0

The new tab pages would then consider this value. If set to 1 or True, they would not display the DDG panel (matching behavior in browser-laptop)

@bsclifton
Copy link
Member Author

cc: @mkarolin who implemented the original logic for search engine defaults with brave/brave-core#516

@srirambv
Copy link
Contributor

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 Qwant was set as default search engine on normal tab
  • Verified no DDG info on Private/Tor tab for France
  • Verified no DDG info on Private/Tor tab for Germany

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 Qwant was set as default search engine on normal tab
  • Verified no DDG info on Private/Tor tab for France
  • Verified no DDG info on Private/Tor tab for Germany

Verified passed with

Brave 0.55.17 Chromium: 70.0.3538.67 (Offizieller Build) (64-Bit)
Überarbeitung 9ab0cfab84ded083718d3a4ff830726efd38869f-refs/branch-heads/3538@{#1002}
Betriebssystem Mac OS X
  • Verified Qwant was set as default search engine on normal, private, Tor tabs
  • Verified no DDG info on Private/Tor tab for France
  • Verified no DDG info on Private/Tor tab for Germany

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