Bug 1211726 - fix: set low frecency, r?gijs draft
authorSvetlana Orlik <sveta.orlik.code@gmail.com>
Thu, 22 Dec 2016 23:14:11 +0300
changeset 453346 dbb512dd51cdd3c969c6ae458d7c2b977228848d
parent 453345 4faa9a83ec3870040e7fc8e19a6df813d48b77ec
child 540430 6572e1cd6f2f3853d139052cd71de5b3916c34c5
push id39636
push userbmo:sveta.orlik.code@gmail.com
push dateFri, 23 Dec 2016 07:50:26 +0000
reviewersgijs
bugs1211726
milestone53.0a1
Bug 1211726 - fix: set low frecency, r?gijs MozReview-Commit-ID: 99I1hPDz4Un
toolkit/components/places/UnifiedComplete.js
--- 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