Omnibox autocomplete does not fully support search engines where terms are part of the query parameter |
|||
Issue descriptionVersion: ToT (96452d073371da1e1ab7eb1ef724df0926f76547-refs/heads/master@{#386464}) OS: All What steps will reproduce the problem? (1) Create a custom search engine with a keyword (e.g. "cr"), whose URL is something like "http://www.google.com/search?q=%s@chromium.org". (2) Repeatedly enter "cr jbroman" into the omnibox, hitting enter each time. (3) Eventually, it will offer to autocomplete (HistoryQuickProvider). However, the autocomplete suggestion will be "jbroman@chromium.org", choosing which leads to a search for "jbroman@chromium.org@chromium.org". Debugging this, it looks like TemplateURLRef assumes that the replacements it provides will always fill a full URL component (e.g. query param). While going from query to URL works fine (it will substitute in the query parameter, leaving the suffix intact), when going in the opposite direction (TemplateURLRef::ExtractSearchTermsFromURL) it just locates the corresponding query key ("q"), and takes the whole value ("jbroman@chromium.org") as the extracted value. Ideally, it would extract "jbroman" (being aware of the prefix/suffix). Another, less convenient, alternative might be not to offer autocomplete suggestions for search engines of this type. I'd fix this myself, but it seems to have larger implications for components/search_engines/.
,
Apr 19 2016
,
Apr 21 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/508320252e351bc010cc25d837b55baf6d0d22c4 commit 508320252e351bc010cc25d837b55baf6d0d22c4 Author: jbroman <jbroman@chromium.org> Date: Thu Apr 21 23:53:00 2016 Support fixed prefixes and suffixes when extracting terms from search template URLs. This causes autocompletions for custom search engines where the query parameter has some prefix or suffix to work correctly, instead of duplicating it. BUG= 602450 TEST=components_unittests:TemplateURLTest.ExtractSearchTermsWithPrefixAndSuffix Review URL: https://codereview.chromium.org/1902263002 Cr-Commit-Position: refs/heads/master@{#388958} [modify] https://crrev.com/508320252e351bc010cc25d837b55baf6d0d22c4/components/search_engines/template_url.cc [modify] https://crrev.com/508320252e351bc010cc25d837b55baf6d0d22c4/components/search_engines/template_url.h [modify] https://crrev.com/508320252e351bc010cc25d837b55baf6d0d22c4/components/search_engines/template_url_unittest.cc
,
Apr 22 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by pkasting@chromium.org
, Apr 11 2016