-
Notifications
You must be signed in to change notification settings - Fork 974
Allow for assigning of default search engine based on country #15154
Conversation
Depends on brave/muon#647 being merged / available Fixes #14647 - Don't show private tab options on search tab (preferences) if default browser was set - Re-show DDG after user manually changes search engine - Use default search engine for private/tor tabs when search engine is defaulted. If user overrides, it'll fall back to DDG
@darkdh made a few more changes - ready for re-review 😄 |
Test Cases + fix for context menu search lgtm on macOS 👍 |
with this PR there seems to be no way to use a different search engine in Tor mode than for regular browsing. is that intentional? |
@diracdeltas that is correct- it'll use the default search engine. However, if the user modifies their search engine preferences in any way, it'll change back to the default behavior (ex: DuckDuckGo is default for Tor- and DDG can also be default (up to user) for regular private tabs) |
@bsclifton i see. i tried changing my default search engine to google, and the options for |
@diracdeltas that is correct (and that is known; apologies for not calling it out). I wasn't sure if that was worth fixing or not |
Went through the above STR that @bsclifton mentioned using
Issues: Only issue that I managed to find was the one @diracdeltas mentioned above regarding the DDG snippet not appearing under PT when the search engine is switched. However, once you either restart or toggle |
@kjozwiak @diracdeltas I fixed the issue with private & tor tabs not immediately re-showing the DDG options (ended up being a lot easier than I had thought 😄). Ready for re-review! 👍 |
- only change value if going from false=>true (should only be called once) - private tab options are reflected immediately on new private/tor tabs Auditors: @kjozwiak, @diracdeltas
This has the new electron.app.getCountryName functionality (with Chromium 68) Auditors: @darkdh
@kjozwiak @LaurenWags @srirambv I also updated this to use Chromium 68 (instead of Chromium 69). Can we give the methods a spot check? 😄 |
Awesome, thanks @bsclifton! We'll recheck the above cases on all the platforms with the new updated PR that uses C68 instead of C69 👍 |
Still an issue on Windows. Verified setting France as region and system format still shows as Google. Same for Germany as well. Issue reproduced by @GeetaSarvadnya as well Recording of the issue: https://drive.google.com/open?id=1eXV-j8An1efM44rQUyK_-Y_-PNPIVmrr |
Using Test Cases/STR from description, verified on macOS Results:
|
Same results on my machine as the above. Seems like this PR doesn't work on Win for some reason but works fine on macOS & Ubuntu. @srirambv also mentioned that he tried changing the language of the OS but that didn't work either. |
Tested on Ubuntu 17.10 on commit 7d5264d Default Search engine - new install - PASS Search engine for Germany/France - new install Search engine for Germany/France - new install - changed search engine to google in about:preferences#search Search engine for Germany/France - update |
@srirambv @kjozwiak @GeetaSarvadnya fixed the issue on Windows! Chrome 68 was putting a unicode null terminator ( We didn't see it with previous code because that was using Chromium 69 (which must have changed this) |
Verified the following scenarios on Windows
Region: Germany
Region: US
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ works on Windows now
Allow for assigning of default search engine based on country
Allow for assigning of default search engine based on country
Allow for assigning of default search engine based on country
Fixes #14647
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
(perform steps on Windows, macOS, and Linux)
Changing the country
macOS
Settings > Language & Region
Windows
All settings
)You'll also need to go into Control Panel > Region and set the
Format
Linux
Push the Windows key and search for region (or language)
Pick
Language Support
Install other languages as needed
Pick the appropriate language (all choices should show country)
reboot for changes to take effect
Setup
brave-development
profile directoryTest default (new install - country doesn't match any config entry)
brave-development
profile directoryUSA
npm run watch
/npm start
)DuckDuckGo
option DOES show on private tab. Try a search and verify it uses the proper engineDuckDuckGo
DOES show (is mentioned). Try a search and verify it uses the proper engineTest country matches a config entry (new install)
brave-development
profile directoryFrance
DuckDuckGo
option DOES NOT show on private tab. Try a search and verify it uses the proper engineDuckDuckGo
DOES NOT show (is NOT mentioned). Try a search and verify it uses the proper engineEnsure default not changed for existing profile
brave-development
profile directoryUSA
Google
France
Google
(no change made)Reviewer Checklist:
Tests