diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 977a8d0be40..1f029c7e787 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -1948,11 +1948,11 @@ var gSearchView = { var elements = []; function createSearchResults(aObjsList, aIsInstall, aIsRemote) { - aObjsList.forEach(function(aObj) { - let score = 0; - if (aQuery.length > 0) { + aObjsList.forEach(function(aObj, aIndex) { + let score = aObjsList.length - aIndex; + if (!aIsRemote && aQuery.length > 0) { score = self.getMatchScore(aObj, aQuery); - if (score == 0 && !aIsRemote) + if (score == 0) return; } diff --git a/toolkit/mozapps/extensions/test/browser/browser_searching.js b/toolkit/mozapps/extensions/test/browser/browser_searching.js index d5bffda77a9..960d8b4225a 100644 --- a/toolkit/mozapps/extensions/test/browser/browser_searching.js +++ b/toolkit/mozapps/extensions/test/browser/browser_searching.js @@ -212,8 +212,8 @@ function get_expected_results(aSortBy, aLocalExpected) { var expectedOrder = null, unknownOrder = null; switch (aSortBy) { case "relevancescore": - expectedOrder = [ "remote4" , "addon2", "remote1" , "remote2", - "install2", "addon1", "install1", "remote3" ]; + expectedOrder = [ "addon2" , "remote1", "install2", "addon1", + "install1", "remote2", "remote3" , "remote4" ]; unknownOrder = []; break; case "name":