Skip to content
  • Marco Bonardo's avatar
    Bug 1676038 - Change partial tab-to-search matching to avoid autofilling... · 4b048acc
    Marco Bonardo authored
    Bug 1676038 - Change partial tab-to-search matching to avoid autofilling unexpected subdomains. r=adw
    
    The previous approach was autofilling partial subdomains from search engines.
    Having a search engine pointing to "developer.mozilla.org, when "moz" was typed
    we ended up autofilling "moz[illa.org]" but pointing to "developer.mozilla.org".
    Unfortunately that made impossible to actually go to "mozilla.org" by typing it.
    
    The new approach instead allows tab-to-search results to appear even if there's
    no autofill, because the provider checks autonomously the autofill threshold.
    There's a downside though, with the old approach we could return more partial
    matches, and the Muxer would pick one, depending on the autofilled host. For
    example we could return "rover.ebay.com" and match it to "eb[ay.it]".
    With the new approach we don't have an autofilled host, and fetching it would
    be expensive, we can only compare the search string with the engine's host.
    For this reason the patch also tries to partially match against the searchForm
    host, that often points to a page the user visits more often.
    
    Differential Revision: https://phabricator.services.mozilla.com/D96942
    4b048acc