Closed Bug 995347 Opened 6 years ago Closed 6 years ago

Entering "h" in URL bar shows "http:/" or "https:/" as autocompletion

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set

Tracking

()

VERIFIED FIXED
Firefox 31
Tracking Status
firefox28 --- affected
firefox29 --- affected
firefox30 --- affected
firefox31 --- affected
fennec + ---

People

(Reporter: bnicholson, Assigned: sahai.anuj16)

Details

Attachments

(2 files, 1 obsolete file)

Attached image screenshot
Rather than completing a domain, I just see "http:/" or "https:/" when entering "h", which isn't very helpful. See screenshot.
Can reproduce in release, so doesn't look like a regression.
Whiteboard: [good first bug?]
tracking-fennec: --- → ?
Hi, I would like to take this up if it's okay.
Hi, I'm a bit unclear on what the expected behavior is in this case. For example, if the suggestion is, say, http://support.mozilla.org/en-US/products/mobile, should typing h just fill in the domain (http://support.mozilla.org) or the entire url (http://support.mozilla.org/en-US/products/mobile)?

Thanks.
Never mind, I found that autocomplete normally fills in segment by segment, so, it should be http://support.mozilla.org/ in the above case.
Assignee: nobody → sahai.anuj16
Status: NEW → ASSIGNED
Attachment #8407776 - Flags: review?(rnewman)
Comment on attachment 8407776 [details] [diff] [review]
Allow domain auto completion when entering "h" in url bar

I don't have time to tackle this right now; Brian?
Attachment #8407776 - Flags: review?(rnewman) → review?(bnicholson)
Comment on attachment 8407776 [details] [diff] [review]
Allow domain auto completion when entering "h" in url bar

Review of attachment 8407776 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks! This could technically break for any results that have a "/" before the 9th character and don't begin with "http://" or "https://", but I can't think of any scenarios where this would actually happen.

::: mobile/android/base/home/BrowserSearch.java
@@ +422,5 @@
>              // Does the completion match against the whole URL? This will match
>              // about: pages, as well as user input including "http://...".
>              if (url.startsWith(searchTerm)) {
> +                return uriSubstringUpToMatchedPath(url, 0,
> +                        searchLength > HTTPS_PREFIX_LENGTH ? searchLength : HTTPS_PREFIX_LENGTH);

Nit: Parens around (searchLength > HTTPS_PREFIX_LENGTH).
Attachment #8407776 - Flags: review?(bnicholson) → review+
This would only be applicable for about:.., http://..., ftp://.. and so on. If a slash (/) appears before the 9th character (can't imagine a real scenario), it would still auto complete till the segment that has the 9th character.
Attachment #8407776 - Attachment is obsolete: true
Attachment #8408280 - Flags: review?(bnicholson)
tracking-fennec: ? → +
Comment on attachment 8408280 [details] [diff] [review]
Allow domain auto completion when entering "h" in url bar [Added parentheses]

Looks good, thanks again!

Are you familiar with the checkin-needed flag? If not: this is the way to get your patch landed after it's ready to go. You can add checkin-needed as a keyword in this bug (top of the page), and one of our volunteers will land it for you.
Attachment #8408280 - Flags: review?(bnicholson) → review+
Hey Brian, thanks a lot, I was hunting through the docs to see what the next step is supposed to be. :)
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/08928202c32b
Keywords: checkin-needed
Whiteboard: [good first bug?] → [good first bug?][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/08928202c32b
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [good first bug?][fixed-in-fx-team] → [good first bug?]
Target Milestone: --- → Firefox 31
Status: RESOLVED → VERIFIED
Whiteboard: [good first bug?]
You need to log in before you can comment on or make changes to this bug.