Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Allow for different default search engines based on region #14647

Closed
bsclifton opened this issue Jul 3, 2018 · 6 comments
Closed

Allow for different default search engines based on region #14647

bsclifton opened this issue Jul 3, 2018 · 6 comments

Comments

@bsclifton
Copy link
Member

bsclifton commented Jul 3, 2018

Original issue description

Brave should use region detection when considering how to set the default search engine (globally and for private tabs)

For example, if I'd like to default to bing.com for Brazil, this should be possible. Currently, the default search is applied regardless of region

The region detection should happen via Node (ex: looking at the computer settings)

@kjozwiak
Copy link
Member

I couldn't get this working after spending a few hours on it last night using both Win 10 x64 and macOS 0.13.6 (17G65) x64. Quick summary:

Prerequisites:

  • changed my machines region to Mexico and changed the language to Spanish Mexico (es-MX)
  • created a new Apple ID that belonged to the Mexico region, logged in and restarted the machine

captura de pantalla 2018-08-15 a la s 01 01 01

captura de pantalla 2018-08-15 a la s 00 59 50

Once the above was completed, I double checked and ensured that my machine was using the correcr regions:

Kamils-MBP:browser-laptop kjozwiak$ defaults read -g AppleLocale
es_MX
Kamils-MBP:browser-laptop kjozwiak$ defaults read NSGlobalDomain AppleLanguages
(
    "es-MX"
)

I also checked the adblocker in brave-core under chrome://adblock and noticed that I was automatically using EeasyList Spanish which means that the code within brave-core is working correctly when it comes to detecting locales, example:

captura de pantalla 2018-08-15 a la s 00 19 56

Using the instructions in #14713, I commented out the required checks under js/constants/config.js#L49-L50 and built from source using the 0.23.x-release5 branch.

Every time I launched brave, it would select GitHub meaning that Brave still thinks I'm on en-US. I ensured I removed the profile on every restart but every time brave was launched, GH was being selected rather than YouTube. After 2-3 hours, I reverted the back to my locale, example:

Kamils-MBP:browser-laptop kjozwiak$ defaults read -g AppleLocale
en_CA
Kamils-MBP:browser-laptop kjozwiak$ defaults read NSGlobalDomain AppleLanguages
(
    "en-CA"
)

After reverting back to my original locale, I attempted re-launching brave several times after removing the profile and I still got GitHub rather then Google. From the looks of the code, I should only be getting GitHub on en-US which isn't the case as I'm on en-CA which should default to Google.

@GeetaSarvadnya and @srirambv weren't able to get this working on Linux/Windows either.

@bsclifton I think we should just move this out for now unless we want to spend the time debugging to figure out what's going on and why it's always using en-US and picking GitHub as the default search engine.

@kjozwiak kjozwiak added the needs-investigation A bug not 100% confirmed/fixed that needs QA to better audit. label Aug 15, 2018
@bsclifton
Copy link
Member Author

Thanks for digging in, @kjozwiak 😄 I agree - we can move this out

The code (as-is) works fine and shouldn't need to be reverted. Removing milestone

@bsclifton
Copy link
Member Author

bsclifton commented Aug 21, 2018

Needs more investigation - setting should affect search in Tor tabs also

@kjozwiak
Copy link
Member

@bsclifton let me know if you need anymore help investigating/looking at this!

bsclifton added a commit to brave/muon that referenced this issue Aug 31, 2018
Works correctly on Windows; need to do macOS/Linux implementation

Auditors: @darkdh, @bridiver
bsclifton added a commit to brave/muon that referenced this issue Aug 31, 2018
Works correctly on Windows; need to do macOS/Linux implementation

Auditors: @darkdh, @bridiver
bsclifton added a commit to brave/muon that referenced this issue Aug 31, 2018
Works correctly on Windows; need to do macOS/Linux implementation

Auditors: @darkdh, @bridiver
@kjozwiak
Copy link
Member

kjozwiak commented Sep 10, 2018

Verified on Ubuntu 18.04 x64 using the following build:

  • 0.23.106 0241c02
  • muon: 8.0.10
  • libchromiumcontent: 68.0.3440.84

Verified on Ubuntu 17.10 x64

  • 0.23.106 0241c02
  • Muon 8.0.10
  • libchromiumcontent 68.0.3440.84

Verified on Windows 10 x64

  • 0.23.106 0241c02
  • Muon 8.0.10
  • libchromiumcontent 68.0.3440.84

Verified with macOS 10.12.6 using

  • 0.23.106 0241c02
  • muon 8.0.10
  • libchromiumcontent | 68.0.3440.84

@LaurenWags
Copy link
Member

LaurenWags commented Sep 11, 2018

Verified with macOS 10.12.6 using

  • 0.23.204 b71d170
  • muon 8.1.3
  • libchromiumcontent 69.0.3497.81

Verified on Windows 10 x64
• 0.23.204 b71d170
• Muon 8.1.3
• libchromiumcontent 69.0.3497.81

Verified on Ubuntu 17.10 x64

  • 0.23.205 81396b3
  • Muon 8.1.4
  • libchromiumcontent 69.0.3497.92

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