summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs')
-rw-r--r--browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs17
1 files changed, 7 insertions, 10 deletions
diff --git a/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs b/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs
index 202e51c9e5..78e254616e 100644
--- a/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs
+++ b/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs
@@ -128,11 +128,15 @@ class ProviderQuickSuggest extends UrlbarProvider {
// Trim only the start of the search string because a trailing space can
// affect the suggestions.
let trimmedSearchString = queryContext.searchString.trimStart();
- if (!trimmedSearchString) {
+
+ // Per product requirements, at least two characters must be typed to
+ // trigger a Suggest suggestion. Suggestion keywords should always be at
+ // least two characters long, but we check here anyway to be safe. Note we
+ // called `trimStart()` above, so we only call `trimEnd()` here.
+ if (trimmedSearchString.trimEnd().length < 2) {
return false;
}
this._trimmedSearchString = trimmedSearchString;
-
return true;
}
@@ -773,9 +777,6 @@ class ProviderQuickSuggest extends UrlbarProvider {
* @param {UrlbarResult} options.result
* The quick suggest result related to the engagement, or null if no result
* was present.
- * @param {string} options.resultSelType
- * If an element in the result's row was clicked, this should be its
- * `selType`. Otherwise it should be an empty string.
* @param {boolean} options.resultClicked
* True if the main part of the result's row was clicked; false if a button
* like help or dismiss was clicked or if no part of the row was clicked.
@@ -786,7 +787,6 @@ class ProviderQuickSuggest extends UrlbarProvider {
#recordNavSuggestionTelemetry({
queryContext,
result,
- resultSelType,
resultClicked,
details,
}) {
@@ -829,11 +829,8 @@ class ProviderQuickSuggest extends UrlbarProvider {
/**
* Cancels the current query.
- *
- * @param {UrlbarQueryContext} queryContext
- * The query context.
*/
- cancelQuery(queryContext) {
+ cancelQuery() {
// Cancel the Rust query.
let backend = lazy.QuickSuggest.getFeature("SuggestBackendRust");
if (backend?.isEnabled) {