summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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) {