Bug 1211726 - fix: set low frecency, r?gijs
MozReview-Commit-ID: 99I1hPDz4Un
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -60,16 +60,17 @@ const TITLE_TAGS_SEPARATOR = " \u2013 ";
const TOP500_SITES = [
["Google.com", "Google"],
["Youtube.com", "YouTube"],
["Facebook.com", "Facebook"],
["Baidu.com", "百度一下,你就知道"],
["Wikipedia.org", "Wikipedia"],
];
+const TOP500_FRECENCY = 0;
// Telemetry probes.
const TELEMETRY_1ST_RESULT = "PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS";
const TELEMETRY_6_FIRST_RESULTS = "PLACES_AUTOCOMPLETE_6_FIRST_RESULTS_TIME_MS";
// The default frecency value used when inserting matches with unknown frecency.
const FRECENCY_DEFAULT = 1000;
// Remote matches are appended when local matches are below a given frecency
@@ -1013,17 +1014,17 @@ Search.prototype = {
*_matchTop500() {
for (let [url, title] of TOP500_SITES) {
if (url.toLowerCase().includes(this._searchString) ||
title.toLowerCase().includes(this._searchString)) {
let match = {
value: url,
comment: title,
style: "bookmark",
- frecency: FRECENCY_DEFAULT + 1,
+ frecency: TOP500_FRECENCY,
};
this._addMatch(match);
};
};
},
*_matchFirstHeuristicResult(conn) {
// We always try to make the first result a special "heuristic" result. The