Adaptive History Autofill in Firefox
This document provides an overview of autofill in Firefox’s address bar with a focus on adaptive history autofill.
|
When the user types a search string in the address bar and picks a result, Firefox stores a database record that associates the search string with the result’s URL. When the user types the search string again – or part of the search string – the address bar will show the result they picked last time. This feature is called adaptive history.
Here are some examples of adaptive history database records:
Example adaptive history records. Each record has a search string and URL. There are other fields in each record as well, discussed later.
Adaptive history autofill is a new feature where the address bar will autofill full URLs based on adaptive history. The address bar will use one feature, adaptive history, to improve another feature, autofill. When the user starts typing a search string that is stored in adaptive history, the associated full URL will be autofilled.
Adaptive history autofill as the user is typing “mozilla”. In this example, there is an adaptive history record with search string “moz” and the URL “mozilla.org/en-US/firefox/”. When the user types “m” and “mo”, origin autofill is used (see below). Once the user types “moz” and continues typing the rest of “mozilla”, adaptive history autofill is used and the full URL is autofilled.
Firefox has two other kinds of autofill: origin autofill and URL autofill. Origin autofill works by autofilling domain names, for example “mozilla.org”, “google.com”, “youtube.com”, etc. As the user begins typing their search string, origin autofill is triggered before URL autofill. In order for a domain name to be autofilled, it must have a frecency value over a certain threshold.
Origin autofill as the user is typing “mozilla”. Only the domain name “mozilla.org” is autofilled.
After the user types a slash (“/”), URL autofill is triggered. URL autofill works by autofilling URLs “up to the next slash.” For example, after the user types “mozilla.org/e”, Firefox may autofill “mozilla.org/en-US/”. If the user then types “f”, Firefox may autofill “mozilla.org/en-US/firefox/”. Only URLs in the user’s history will be autofilled.
URL autofill. The URL “mozilla.org/en-US/firefox/” is autofilled up to the next slash as the user types “en-US” and “firefox”.
Origin and URL autofill still exist, but adaptive history autofill will now take precedence. When a record exists in adaptive history that starts with the user’s search string, adaptive history autofill will be used; otherwise Firefox will fall back to origin or URL autofill.
In order to trigger adaptive history autofill, first you’ll need to add some adaptive history. An adaptive history database record is created or updated when all of the following are true:
Each adaptive history record has a use count that is proportional to the number of times the record was updated. In other words, it’s proportional to the number of times the user typed the record’s search string and picked its URL. Records with larger use counts have been used more often (and more recently) than records with smaller use counts.
The use count is not a simple integer that’s incremented each time the record is updated. Instead it is incremented with a value proportional to itself such that the use count will never be greater than 10. It’s not important to understand the math.
The use counts of all records are decreased (“decayed”) periodically. This prevents records that have not been updated recently from keeping a high use count.
To remove an adaptive history record, remove its URL from browsing history and bookmarks. URLs can be removed from browsing history in any of the following usual ways:
There’s no way to remove adaptive history without removing browsing history. That means there’s no way to prevent adaptive history autofill from being triggered for a certain search string and URL other than removing the URL from browsing history (or disabling autofill).
To trigger an adaptive history record for autofill without the experiment, all of the following must be true:
Triggering adaptive history autofill while enrolled in the treatment branch of the experiment is similar to the previous section but not exactly the same. There is one additional condition that must be true:
This means if an adaptive history record’s search string is less than 4 characters long, its URL cannot be autofilled until the user types at least 4 characters. For example, if a record’s search string is “moz” and the user types “moz”, the record’s URL will not be autofilled. If the user then types one more character, e.g. “mozi”, the URL will be autofilled as long as its URL starts with “mozi”.
The purpose of this extra condition is to make it less likely that adaptive history autofill will annoy the user.
The search string the user is typing may match multiple records in adaptive history. Firefox will pick the one using the following priority logic:
If no adaptive history record matches, then Firefox will fall back to origin and URL autofill. Of course it’s possible that the user’s search string won’t trigger any kind of autofill.
This is the global toggle for all autofill. When it’s false, all autofill should be disabled (including all three types: adaptive history, origin, and URL).
Enables or disables the adaptive history autofill feature. It’s currently disabled by default. This pref is not related to origin or URL autofill, so when it’s false, origin and URL autofill should remain enabled (unless all autofill has been disabled using browser.urlbar.autoFill).
In order to trigger any adaptive history autofill, the search string the user is typing must be at least this many characters. Its default value without the experiment is 0, which means there is no threshold. In the treatment branch of the experiment, the threshold is set to 4 (but note that the threshold in that case is set using a Nimbus variable, not the pref, so the pref value will remain 0).
In order for an adaptive history record to be autofilled, its use count must be at least this threshold value. Its default value is 0.47.