-
Notifications
You must be signed in to change notification settings - Fork 965
Default search engines by region #516
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
Conversation
Immediate questions:
|
@bsclifton Thanks, I chatted with @bridiver about the patching as well. Making some changes now to override only what's necessary and minimize code duplication. |
Notes as I'm testing 😄
|
6f58585
to
a490115
Compare
@bsclifton from what I have seen, the favicons show up only once you have visited the site. |
36d6413
to
13165cf
Compare
@bsclifton: updated keywords to match those in |
13165cf
to
ecef852
Compare
Fixes brave/brave-browser#731 Overrode Chromium's set of prepopulated search engines with our own set and regional defaults. Added new unit tests to: * check for duplicate prepopulate ids and keywords * check for correct default search engine based on locale * check that prepopulated engines have all required fields
…ction to preserve engines order. Added a new unit test to verify that GetSearchProvidersUsingKeywordResult preserves engines order.
ecef852
to
5569e14
Compare
For privacy reasons, please do not download the favicons remotely. In b-l we include them in the Brave package and load them from file:///. |
you can find them in |
L"Yandex", | ||
L":ya", | ||
"https://yandex.st/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico", | ||
"https://yandex.com/search/?text={searchTerms}&clid=2274777", |
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.
looks like originally clid was set by client OS? https://github.com/brave/browser-laptop/pull/5964/files#diff-1e3d00f00cc34a0805abaafa53c7d7a0R134
i'm ok with setting it to be a constant
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.
I copied this directly from https://github.com/brave/browser-laptop/blob/master/js/data/searchProviders.js which doesn't appear to have "platformClientId" any more.
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.
Good find, @diracdeltas - I forgot about that... I wonder if that regressed on purpose? Gonna take a peek
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.
OK interesting- it was removed by @bridiver via brave/browser-laptop@c001b8b#diff-1e3d00f00cc34a0805abaafa53c7d7a0 during a refactor. I'll double check that we don't want platform ID and report back (having the platform could potentially be a privacy violation, right?)
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.
update: we are good to go 😄 we don't need to pass platformClientId
👍
question - where is the code that actually loads/renders the favicons in the list? looks like it's not in this PR |
That's Chromium functionality that I didn't touch in this PR. It looks to me like in the UI the icon is loaded via src/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html |
@mkarolin thanks. do you know at what point Chromium makes a fetch to the favicon URL specified in PrepopulatedEngine (ex: https://github.com/brave/brave-core/pull/516/files#diff-7e5cc9096d62b4d079ea4a59f4d66d1bR18)? |
The process of getting a favicon is the same in either case:
So, it looks to me like at no point it actually attempts to fetch the favicon "live". This is consistent with the observed behavior on the search engines settings page that the icon for a search engine only appears after you'd visited that search engine (and, likely, only if the current search engine favicon URL matches what we have in our prepopulated engines). Once the icon is in the thumbnails database, then it is shown. |
@mkarolin I have confirmed your findings above 😄 Basically, it tries to load a favicon (using CSS) via: This lookup will hit the If an icon is found, it shows. If not, it doesn't show. I confirmed these icons don't show after deleting the |
Thanks @bsclifton. If that's the case then favicons are probably not a privacy concern. |
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.
I ran through each test in the test plan: works perfectly! Code + unit tests looks great to me too (tests pass). I verified the findings about favicon URL (page will not make outbound requests, which is great). Awesome job on this one, @mkarolin! 😄👍
Default search engines by region
Default search engines by region
Fixes brave/brave-browser#893
Fixes brave/brave-browser#731
Overrides Chromium's set of prepopulated search engines with our own set and regional defaults.
Makes Qwant the default search engine for Germany and France.
Modifies search engine retrieval code to preserve the order of search engines.
Adds unit tests for search engine prepopulate data and util.
Deviates from
Issue 731
in the following ways:Submitter Checklist:
git rebase -i
to squash commits (if needed).Automated Test Plan
npm run test -- brave_unit_tests --filter=BraveTemplateURLPrepopulateDataTest.*
npm run test -- brave_unit_tests --filter=BraveTemplateURLServiceUtilTest.*
Test Plan:
Search Engine
sectionSearch engine used in the address bar
is set to Google.Manage search engines
and verify that the same engines are listed and have correctKeyword
associated with them.Yahoo! Quebec
is also present in the listYahoo! France
orYahoo! Deutschland
)keywords
(e.g.:g
) and press TabSearch XXX
where XXX is the search engine associated with the typed keywordchrome://settings/searchEngines
...
of an engine that isn't the default and selectMake default
chrome://settings/searchEngines
...
of an engine that isn't the default and selectRemove from list
chrome://settings/resetProfileSettings?origin=userclick
Reset settings
pop-up clickReset settings
chrome://settings/searchEngines
and verify that the list has been restored to the original state (removed items are back in the list, default is reset)chrome://settings/searchEngines
Reviewer Checklist: