"test " and "example " treated as URLs in addressbar |
||||
Issue descriptionChrome Version: 66.0.3358.0 (Official Build) canary (64-bit) OS: ALL What steps will reproduce the problem? (1) type "test " in address bar (2) press enter (3) What is the expected result? Search for "test " is performed What happens instead? Browser navigates to "test/" Please use labels and text to provide additional information. For graphics-related bugs, please copy/paste the contents of the about:gpu page at the end of this report.
,
Mar 5 2018
Obviously fallout from bug 782146 . In https://chromium-review.googlesource.com/c/chromium/src/+/831214/7/components/omnibox/browser/autocomplete_input.cc , instead of checking "text is not exactly 'test' or 'example' we should probably have done something like 'canonicalized URL has more than one component'".
,
Mar 5 2018
(canonicalized host, not canonicalized url)
,
Mar 6 2018
,
Mar 6 2018
It seems like a good idea to specifically trim the whitespace. pkasting@ is trimming the whitespace reasonable?
,
Mar 6 2018
That feels fragile to me, compared to relying on the canonicalizer/RCDS systems.
,
Mar 6 2018
Ah, it felt fragile to me to rely on an indirect indicator (vs. testing explicitly). Maybe I'm misunderstanding: "more than one component". (A) Did you mean 'canonicalized URL has more than one label*'? If so, will I be looking in the string for a period (.) or is there something that already counts the labels*? (B) Or if 'component' is a url_parse.h:Component struct, does that mean that the GURL also has a password, port, path, query, or ref in addition to host(?). "foo.test" should still be treated as a URL, even if it doesn't have a path, port, etc. I'm not seeing how checking for other Components is better (it seems like it would have unintended side effects). I'm okay doing something other than trimming the string and explicitly checking for "test" or "example", (but it would be keen to learn the "why" of it). *IIUC the pieces of a host are "labels" (which I'm sure you know, but I don't know if you're using 'component' informally -- or if ya formally mean 'A Component class instance').
,
Mar 6 2018
Err, also, afaik, if we go with (A) in #7, we'd still need to check for "test" or "example", because "localhost"* should navigate to localhost (even though it has a single label). *and maybe others, I'm not sure.
,
Mar 6 2018
Here are inputs that also probably shouldn't navigate but does, and the whitespace test wouldn't catch: "test." (with any number of trailing periods), ".test" (with any number of leading periods). @7: (A), and I think what you want is to check if the length of the canonicalized hostname is more than |registry_length| + 1? That would indicate it has at least one other component.
,
Mar 6 2018
#9 Very helpful! Thanks!
,
Mar 8 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7b840bc911107d6e3ee0e00e127ef076340d872a commit 7b840bc911107d6e3ee0e00e127ef076340d872a Author: Dave Schuyler <dschuyler@chromium.org> Date: Thu Mar 08 00:22:04 2018 [Omnibox] fix for trailing whitespace on "test" and "example" This CL suggests that the words "test" and "example" be treated as QUERY regardless of whether whitespace is present (e.g. "test "). Without this CL something like "test " (with a trailing space) will be UNKNOWN, which may be treated as a URL or QUERY (it's not explicit -- this CL makes it explicit). Bug: 818137 Change-Id: Iedaa4e3c06782a9d9131d3e91d3cee87c1dee7ab Reviewed-on: https://chromium-review.googlesource.com/950235 Commit-Queue: Dave Schuyler <dschuyler@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#541650} [modify] https://crrev.com/7b840bc911107d6e3ee0e00e127ef076340d872a/components/omnibox/browser/autocomplete_input.cc [modify] https://crrev.com/7b840bc911107d6e3ee0e00e127ef076340d872a/components/omnibox/browser/autocomplete_input_unittest.cc
,
Mar 8 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by dtapu...@chromium.org
, Mar 5 2018