commit bf4841e5a17c3d8851ad7597dbbe3be623ecc268
parent 8a79d4eeeaee24d3b7f3b637f6b042074250089d
Author: Moritz Beier <mbeier@mozilla.com>
Date: Tue, 30 Dec 2025 14:03:31 +0000
Bug 2007126 - Disable UrlbarProviderHeuristicFallback on empty searches. r=urlbar-reviewers,mak
Differential Revision: https://phabricator.services.mozilla.com/D277338
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs b/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs
@@ -44,9 +44,11 @@ export class UrlbarProviderHeuristicFallback extends UrlbarProvider {
* Whether this provider should be invoked for the given context.
* If this method returns false, the providers manager won't start a query
* with this provider, to save on resources.
+ *
+ * @param {UrlbarQueryContext} queryContext
*/
- async isActive() {
- return true;
+ async isActive(queryContext) {
+ return !!queryContext.searchString.length;
}
/**
diff --git a/browser/components/urlbar/tests/unit/test_providerHeuristicFallback.js b/browser/components/urlbar/tests/unit/test_providerHeuristicFallback.js
@@ -827,6 +827,13 @@ add_task(async function dont_fixup_urls_with_at_symbol() {
}),
],
});
+
+ query = "";
+ context = createContext(query, { isPrivate: false });
+ await check_results({
+ context,
+ matches: [],
+ });
});
/**