tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 33b9ba8a2f4b6a7f6d17716a2beadc21bc9610e0
parent d6e7b12f0a7168d0c52239d5702f826155210e80
Author: Mark Banner <standard8@mozilla.com>
Date:   Wed,  5 Nov 2025 10:53:24 +0000

Bug 1997002 - Improve TypeScript definitions for UrlbarProvider.startQuery and copy it across to all of the urlbar providers. r=urlbar-reviewers,jteow

Differential Revision: https://phabricator.services.mozilla.com/D270429

Diffstat:
Mbrowser/components/urlbar/UrlbarProviderAboutPages.sys.mjs | 9++++-----
Mbrowser/components/urlbar/UrlbarProviderActionsSearchMode.sys.mjs | 7+++++++
Mbrowser/components/urlbar/UrlbarProviderAliasEngines.sys.mjs | 6+++---
Mbrowser/components/urlbar/UrlbarProviderAutofill.sys.mjs | 7+++----
Mbrowser/components/urlbar/UrlbarProviderBookmarkKeywords.sys.mjs | 6+++---
Mbrowser/components/urlbar/UrlbarProviderCalculator.sys.mjs | 9++++-----
Mbrowser/components/urlbar/UrlbarProviderClipboard.sys.mjs | 7+++++++
Mbrowser/components/urlbar/UrlbarProviderGlobalActions.sys.mjs | 7+++++++
Mbrowser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs | 7+++----
Mbrowser/components/urlbar/UrlbarProviderHistoryUrlHeuristic.sys.mjs | 7+++----
Mbrowser/components/urlbar/UrlbarProviderInputHistory.sys.mjs | 10++++------
Mbrowser/components/urlbar/UrlbarProviderInterventions.sys.mjs | 6+++---
Mbrowser/components/urlbar/UrlbarProviderOmnibox.sys.mjs | 8+++-----
Mbrowser/components/urlbar/UrlbarProviderOpenTabs.sys.mjs | 7+++----
Mbrowser/components/urlbar/UrlbarProviderPlaces.sys.mjs | 5+----
Mbrowser/components/urlbar/UrlbarProviderPrivateSearch.sys.mjs | 7+++----
Mbrowser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs | 10++++------
Mbrowser/components/urlbar/UrlbarProviderQuickSuggestContextualOptIn.sys.mjs | 7+++----
Mbrowser/components/urlbar/UrlbarProviderRecentSearches.sys.mjs | 7+++++++
Mbrowser/components/urlbar/UrlbarProviderRemoteTabs.sys.mjs | 9++++-----
Mbrowser/components/urlbar/UrlbarProviderRestrictKeywords.sys.mjs | 7+++++++
Mbrowser/components/urlbar/UrlbarProviderRestrictKeywordsAutofill.sys.mjs | 7+++++++
Mbrowser/components/urlbar/UrlbarProviderSearchSuggestions.sys.mjs | 7+++----
Mbrowser/components/urlbar/UrlbarProviderSearchTips.sys.mjs | 10++++------
Mbrowser/components/urlbar/UrlbarProviderSemanticHistorySearch.sys.mjs | 9++++-----
Mbrowser/components/urlbar/UrlbarProviderTabToSearch.sys.mjs | 7+++----
Mbrowser/components/urlbar/UrlbarProviderTokenAliasEngines.sys.mjs | 6+++---
Mbrowser/components/urlbar/UrlbarProviderTopSites.sys.mjs | 10++++------
Mbrowser/components/urlbar/UrlbarProviderUnitConversion.sys.mjs | 8+++-----
Mbrowser/components/urlbar/UrlbarUtils.sys.mjs | 8+++++---
30 files changed, 122 insertions(+), 105 deletions(-)

diff --git a/browser/components/urlbar/UrlbarProviderAboutPages.sys.mjs b/browser/components/urlbar/UrlbarProviderAboutPages.sys.mjs @@ -41,12 +41,11 @@ export class UrlbarProviderAboutPages extends UrlbarProvider { } /** - * Starts querying. Extended classes should return a Promise resolved when the - * provider is done searching AND returning results. + * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ startQuery(queryContext, addCallback) { let searchString = queryContext.trimmedLowerCaseSearchString; diff --git a/browser/components/urlbar/UrlbarProviderActionsSearchMode.sys.mjs b/browser/components/urlbar/UrlbarProviderActionsSearchMode.sys.mjs @@ -39,6 +39,13 @@ export class UrlbarProviderActionsSearchMode extends UrlbarProvider { return queryContext.searchMode?.source == UrlbarUtils.RESULT_SOURCE.ACTIONS; } + /** + * Starts querying. + * + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. + */ async startQuery(queryContext, addCallback) { let input = queryContext.trimmedLowerCaseSearchString; let results = await lazy.ActionsProviderQuickActions.getActions({ diff --git a/browser/components/urlbar/UrlbarProviderAliasEngines.sys.mjs b/browser/components/urlbar/UrlbarProviderAliasEngines.sys.mjs @@ -50,9 +50,9 @@ export class UrlbarProviderAliasEngines extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderAutofill.sys.mjs b/browser/components/urlbar/UrlbarProviderAutofill.sys.mjs @@ -413,10 +413,9 @@ export class UrlbarProviderAutofill extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. - * @returns {Promise} resolved when the query stops. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { // Check if the query was cancelled while the autofill result was being diff --git a/browser/components/urlbar/UrlbarProviderBookmarkKeywords.sys.mjs b/browser/components/urlbar/UrlbarProviderBookmarkKeywords.sys.mjs @@ -48,9 +48,9 @@ export class UrlbarProviderBookmarkKeywords extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let keyword = queryContext.tokens[0]?.value; diff --git a/browser/components/urlbar/UrlbarProviderCalculator.sys.mjs b/browser/components/urlbar/UrlbarProviderCalculator.sys.mjs @@ -105,12 +105,11 @@ export class UrlbarProviderCalculator extends UrlbarProvider { } /** - * Starts querying. Extended classes should return a Promise resolved when the - * provider is done searching AND returning results. + * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { try { diff --git a/browser/components/urlbar/UrlbarProviderClipboard.sys.mjs b/browser/components/urlbar/UrlbarProviderClipboard.sys.mjs @@ -106,6 +106,13 @@ export class UrlbarProviderClipboard extends UrlbarProvider { return 1; } + /** + * Starts querying. + * + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. + */ async startQuery(queryContext, addCallback) { // If the query was started, isActive should have cached a url already. let result = new lazy.UrlbarResult({ diff --git a/browser/components/urlbar/UrlbarProviderGlobalActions.sys.mjs b/browser/components/urlbar/UrlbarProviderGlobalActions.sys.mjs @@ -69,6 +69,13 @@ export class UrlbarProviderGlobalActions extends UrlbarProvider { return isActive; } + /** + * Starts querying. + * + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. + */ async startQuery(queryContext, addCallback) { let actionsResults = []; let searchModeEngine = ""; diff --git a/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs b/browser/components/urlbar/UrlbarProviderHeuristicFallback.sys.mjs @@ -61,10 +61,9 @@ export class UrlbarProviderHeuristicFallback extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. - * @returns {Promise} resolved when the query stops. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderHistoryUrlHeuristic.sys.mjs b/browser/components/urlbar/UrlbarProviderHistoryUrlHeuristic.sys.mjs @@ -54,10 +54,9 @@ export class UrlbarProviderHistoryUrlHeuristic extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. - * @returns {Promise} resolved when the query stops. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { const instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs b/browser/components/urlbar/UrlbarProviderInputHistory.sys.mjs @@ -95,13 +95,11 @@ export class UrlbarProviderInputHistory extends UrlbarProvider { } /** - * Starts querying. Extended classes should return a Promise resolved when the - * provider is done searching AND returning results. + * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. - * @returns {Promise} + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderInterventions.sys.mjs b/browser/components/urlbar/UrlbarProviderInterventions.sys.mjs @@ -594,9 +594,9 @@ export class UrlbarProviderInterventions extends UrlbarProvider { /** * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderOmnibox.sys.mjs b/browser/components/urlbar/UrlbarProviderOmnibox.sys.mjs @@ -86,13 +86,11 @@ export class UrlbarProviderOmnibox extends UrlbarProvider { } /** - * This method is called by the providers manager when a query starts to fetch - * each extension provider's results. It fires the resultsRequested event. + * Starts querying. * * @param {UrlbarQueryContext} queryContext - * The query context object. - * @param {Function} addCallback - * The callback invoked by this method to add each result. + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderOpenTabs.sys.mjs b/browser/components/urlbar/UrlbarProviderOpenTabs.sys.mjs @@ -315,10 +315,9 @@ export class UrlbarProviderOpenTabs extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * match. - * @returns {Promise} resolved when the query stops. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { // Note: this is not actually expected to be used as an internal provider, diff --git a/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs b/browser/components/urlbar/UrlbarProviderPlaces.sys.mjs @@ -1507,12 +1507,9 @@ export class UrlbarProviderPlaces extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext - * The query context object + * @param {UrlbarQueryContext} queryContext * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback * Callback invoked by the provider to add a new result. - * @returns {Promise<void>} - * Resolved when the query stops. */ startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderPrivateSearch.sys.mjs b/browser/components/urlbar/UrlbarProviderPrivateSearch.sys.mjs @@ -55,10 +55,9 @@ export class UrlbarProviderPrivateSearch extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * match. - * @returns {Promise} resolved when the query stops. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let searchString = queryContext.trimmedSearchString; diff --git a/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs b/browser/components/urlbar/UrlbarProviderQuickSuggest.sys.mjs @@ -87,13 +87,11 @@ export class UrlbarProviderQuickSuggest extends UrlbarProvider { } /** - * Starts querying. Extended classes should return a Promise resolved when the - * provider is done searching AND returning results. + * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. - * @returns {Promise} + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderQuickSuggestContextualOptIn.sys.mjs b/browser/components/urlbar/UrlbarProviderQuickSuggestContextualOptIn.sys.mjs @@ -315,10 +315,9 @@ export class UrlbarProviderQuickSuggestContextualOptIn extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. - * @returns {Promise} resolved when the query stops. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let result = new lazy.UrlbarResult({ diff --git a/browser/components/urlbar/UrlbarProviderRecentSearches.sys.mjs b/browser/components/urlbar/UrlbarProviderRecentSearches.sys.mjs @@ -82,6 +82,13 @@ export class UrlbarProviderRecentSearches extends UrlbarProvider { } } + /** + * Starts querying. + * + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. + */ async startQuery(queryContext, addCallback) { let engine = lazy.UrlbarSearchUtils.getDefaultEngine( queryContext.isPrivate diff --git a/browser/components/urlbar/UrlbarProviderRemoteTabs.sys.mjs b/browser/components/urlbar/UrlbarProviderRemoteTabs.sys.mjs @@ -167,12 +167,11 @@ export class UrlbarProviderRemoteTabs extends UrlbarProvider { } /** - * Starts querying. Extended classes should return a Promise resolved when the - * provider is done searching AND returning results. + * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderRestrictKeywords.sys.mjs b/browser/components/urlbar/UrlbarProviderRestrictKeywords.sys.mjs @@ -49,6 +49,13 @@ export class UrlbarProviderRestrictKeywords extends UrlbarProvider { return !queryContext.searchMode && queryContext.trimmedSearchString == "@"; } + /** + * Starts querying. + * + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. + */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; let tokenToKeyword = await lazy.UrlbarTokenizer.getL10nRestrictKeywords(); diff --git a/browser/components/urlbar/UrlbarProviderRestrictKeywordsAutofill.sys.mjs b/browser/components/urlbar/UrlbarProviderRestrictKeywordsAutofill.sys.mjs @@ -106,6 +106,13 @@ export class UrlbarProviderRestrictKeywordsAutofill extends UrlbarProvider { return false; } + /** + * Starts querying. + * + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. + */ async startQuery(queryContext, addCallback) { if ( this.#autofillData && diff --git a/browser/components/urlbar/UrlbarProviderSearchSuggestions.sys.mjs b/browser/components/urlbar/UrlbarProviderSearchSuggestions.sys.mjs @@ -223,10 +223,9 @@ export class UrlbarProviderSearchSuggestions extends UrlbarProvider { /** * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. - * @returns {Promise} resolved when the query stops. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderSearchTips.sys.mjs b/browser/components/urlbar/UrlbarProviderSearchTips.sys.mjs @@ -159,13 +159,11 @@ export class UrlbarProviderSearchTips extends UrlbarProvider { } /** - * Starts querying. Extended classes should return a Promise resolved when the - * provider is done searching AND returning results. + * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. - * @returns {Promise} + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderSemanticHistorySearch.sys.mjs b/browser/components/urlbar/UrlbarProviderSemanticHistorySearch.sys.mjs @@ -111,12 +111,11 @@ export class UrlbarProviderSemanticHistorySearch extends UrlbarProvider { } /** - * Starts a semantic search query. + * Starts querying. * - * @param {object} queryContext - * The query context, including the search string. - * @param {Function} addCallback - * Callback to add results to the URL bar. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { let instance = this.queryInstance; diff --git a/browser/components/urlbar/UrlbarProviderTabToSearch.sys.mjs b/browser/components/urlbar/UrlbarProviderTabToSearch.sys.mjs @@ -253,10 +253,9 @@ export class UrlbarProviderTabToSearch extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. - * @returns {Promise} resolved when the query stops. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { // enginesForDomainPrefix only matches against engine domains. diff --git a/browser/components/urlbar/UrlbarProviderTokenAliasEngines.sys.mjs b/browser/components/urlbar/UrlbarProviderTokenAliasEngines.sys.mjs @@ -100,9 +100,9 @@ export class UrlbarProviderTokenAliasEngines extends UrlbarProvider { /** * Starts querying. * - * @param {object} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { if (!this._engines || !this._engines.length) { diff --git a/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs b/browser/components/urlbar/UrlbarProviderTopSites.sys.mjs @@ -94,13 +94,11 @@ export class UrlbarProviderTopSites extends UrlbarProvider { } /** - * Starts querying. Extended classes should return a Promise resolved when the - * provider is done searching AND returning results. + * Starts querying. * - * @param {UrlbarQueryContext} queryContext The query context object - * @param {Function} addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. - * @returns {Promise} + * @param {UrlbarQueryContext} queryContext + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ async startQuery(queryContext, addCallback) { // Bail if Top Sites are not enabled. We check this condition here instead diff --git a/browser/components/urlbar/UrlbarProviderUnitConversion.sys.mjs b/browser/components/urlbar/UrlbarProviderUnitConversion.sys.mjs @@ -134,13 +134,11 @@ export class UrlbarProviderUnitConversion extends UrlbarProvider { } /** - * This method is called by the providers manager when a query starts to fetch - * each extension provider's results. It fires the resultsRequested event. + * Starts querying. * * @param {UrlbarQueryContext} queryContext - * The query context object. - * @param {Function} addCallback - * The callback invoked by this method to add each result. + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} addCallback + * Callback invoked by the provider to add a new result. */ startQuery(queryContext, addCallback) { const result = new lazy.UrlbarResult({ diff --git a/browser/components/urlbar/UrlbarUtils.sys.mjs b/browser/components/urlbar/UrlbarUtils.sys.mjs @@ -2777,9 +2777,11 @@ export class UrlbarProvider { * Note: Extended classes should return a Promise resolved when the provider * is done searching AND returning results. * - * @param {UrlbarQueryContext} _queryContext The query context object - * @param {Function} _addCallback Callback invoked by the provider to add a new - * result. A UrlbarResult should be passed to it. + * @param {UrlbarQueryContext} _queryContext + * The query context object + * @param {(provider: UrlbarProvider, result: UrlbarResult) => void} _addCallback + * Callback invoked by the provider to add a new result. + * @returns {void|Promise<void>} * @abstract */ startQuery(_queryContext, _addCallback) {