Bug 1547673 - Quantumbar: For empty @token searches, show only the "Search with" text in the first result, not also the token. r=dao
authorDrew Willcoxon <adw@mozilla.com>
Thu, 16 May 2019 16:17:30 +0000
changeset 474212 ef90ec1b75ea67bea9db8cca282c9852d73794db
parent 474211 ca120c3031d2db4c2d9bff03a1334ee25e8c8502
child 474213 7a0539ac539fe33bc1883fb18aa5b98141600c96
push id36027
push usershindli@mozilla.com
push dateFri, 17 May 2019 16:24:38 +0000
treeherdermozilla-central@c94c54aff466 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1547673
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547673 - Quantumbar: For empty @token searches, show only the "Search with" text in the first result, not also the token. r=dao Differential Revision: https://phabricator.services.mozilla.com/D31487
browser/components/urlbar/UrlbarResult.jsm
--- a/browser/components/urlbar/UrlbarResult.jsm
+++ b/browser/components/urlbar/UrlbarResult.jsm
@@ -107,17 +107,19 @@ class UrlbarResult {
       case UrlbarUtils.RESULT_TYPE.URL:
       case UrlbarUtils.RESULT_TYPE.OMNIBOX:
       case UrlbarUtils.RESULT_TYPE.REMOTE_TAB:
         return this.payload.title ?
                [this.payload.title, this.payloadHighlights.title] :
                [this.payload.url || "", this.payloadHighlights.url || []];
       case UrlbarUtils.RESULT_TYPE.SEARCH:
         if (this.payload.isKeywordOffer) {
-          return [this.payload.keyword, this.payloadHighlights.keyword];
+          return this.heuristic ?
+                 ["", []] :
+                 [this.payload.keyword, this.payloadHighlights.keyword];
         }
         return this.payload.suggestion ?
                [this.payload.suggestion, this.payloadHighlights.suggestion] :
                [this.payload.query, this.payloadHighlights.query];
       default:
         return ["", []];
     }
   }