Bug 1780017 - Migrate browser/components/urlbar to ESM. r=adw

Differential Revision: https://phabricator.services.mozilla.com/D152056
This commit is contained in:
Mark Banner 2022-07-25 12:46:47 +00:00
Родитель 4fa4e507f4
Коммит 4a76c34f68
45 изменённых файлов: 96 добавлений и 190 удалений

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["QuickActionsLoaderDefault"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -178,7 +176,7 @@ function restartBrowser() {
/**
* Loads the default QuickActions.
*/
class QuickActionsLoaderDefault {
export class QuickActionsLoaderDefault {
static load() {
for (const key in DEFAULT_ACTIONS) {
lazy.UrlbarProviderQuickActions.addAction(key, DEFAULT_ACTIONS[key]);

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarController"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -58,7 +56,7 @@ const NOTIFICATIONS = {
* - onViewOpen()
* - onViewClose()
*/
class UrlbarController {
export class UrlbarController {
/**
* Initialises the class. The manager may be overridden here, this is for
* test purposes.

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarEventBufferer"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -55,7 +53,7 @@ const QUERY_STATUS = {
* To prevent that undesirable behavior, certain keys are buffered and deferred
* until more results arrive, at which time they're replayed.
*/
class UrlbarEventBufferer {
export class UrlbarEventBufferer {
/**
* Initialises the class.
* @param {UrlbarInput} input The urlbar input object.

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarInput"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -64,7 +62,7 @@ let px = number => number.toFixed(2) + "px";
/**
* Implements the text input part of the address bar UI.
*/
class UrlbarInput {
export class UrlbarInput {
/**
* @param {object} options
* The initial options for UrlbarInput.

Просмотреть файл

@ -8,8 +8,6 @@
* This module exports a component used to sort results in a UrlbarQueryContext.
*/
var EXPORTED_SYMBOLS = ["UrlbarMuxerUnifiedComplete"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -1246,4 +1244,4 @@ class MuxerUnifiedComplete extends UrlbarMuxer {
}
}
var UrlbarMuxerUnifiedComplete = new MuxerUnifiedComplete();
export var UrlbarMuxerUnifiedComplete = new MuxerUnifiedComplete();

Просмотреть файл

@ -10,8 +10,6 @@
* preferences, but only for variables with fallback prefs.
*/
var EXPORTED_SYMBOLS = ["UrlbarPrefs"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -1473,4 +1471,4 @@ class Preferences {
}
}
var UrlbarPrefs = new Preferences();
export var UrlbarPrefs = new Preferences();

Просмотреть файл

@ -8,8 +8,6 @@
* This module exports a provider that offers about pages.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderAboutPages"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -84,4 +82,4 @@ class ProviderAboutPages extends UrlbarProvider {
}
}
var UrlbarProviderAboutPages = new ProviderAboutPages();
export var UrlbarProviderAboutPages = new ProviderAboutPages();

Просмотреть файл

@ -9,8 +9,6 @@
* results.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderAliasEngines"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -95,4 +93,4 @@ class ProviderAliasEngines extends UrlbarProvider {
}
}
var UrlbarProviderAliasEngines = new ProviderAliasEngines();
export var UrlbarProviderAliasEngines = new ProviderAliasEngines();

Просмотреть файл

@ -8,8 +8,6 @@
* This module exports a provider that provides an autofill result.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderAutofill"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -1040,4 +1038,4 @@ class ProviderAutofill extends UrlbarProvider {
}
}
var UrlbarProviderAutofill = new ProviderAutofill();
export var UrlbarProviderAutofill = new ProviderAutofill();

Просмотреть файл

@ -8,8 +8,6 @@
* This module exports a provider that offers bookmarks with keywords.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderBookmarkKeywords"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -119,4 +117,4 @@ class ProviderBookmarkKeywords extends UrlbarProvider {
}
}
var UrlbarProviderBookmarkKeywords = new ProviderBookmarkKeywords();
export var UrlbarProviderBookmarkKeywords = new ProviderBookmarkKeywords();

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarProviderCalculator", "Calculator"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -430,7 +428,7 @@ Parser.prototype = {
},
};
let Calculator = new BaseCalculator();
export let Calculator = new BaseCalculator();
Calculator.addNumberSystem({
isOperator: char => ["÷", "×", "-", "+", "*", "/"].includes(char),
@ -460,4 +458,4 @@ Calculator.addNumberSystem({
},
});
var UrlbarProviderCalculator = new ProviderCalculator();
export var UrlbarProviderCalculator = new ProviderCalculator();

Просмотреть файл

@ -9,8 +9,6 @@
* extensions.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderExtension"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -44,7 +42,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
* related to a provider, the API implementation should call setEventListener()
* to register its own event listener with the provider.
*/
class UrlbarProviderExtension extends UrlbarProvider {
export class UrlbarProviderExtension extends UrlbarProvider {
/**
* Returns the extension provider with the given name, creating it first if
* it doesn't exist.

Просмотреть файл

@ -10,8 +10,6 @@
* always the ultimate fallback for any query, so this provider is always active.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderHeuristicFallback"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -327,4 +325,4 @@ class ProviderHeuristicFallback extends UrlbarProvider {
}
}
var UrlbarProviderHeuristicFallback = new ProviderHeuristicFallback();
export var UrlbarProviderHeuristicFallback = new ProviderHeuristicFallback();

Просмотреть файл

@ -11,8 +11,6 @@
* string.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderInputHistory"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -226,4 +224,4 @@ class ProviderInputHistory extends UrlbarProvider {
}
}
var UrlbarProviderInputHistory = new ProviderInputHistory();
export var UrlbarProviderInputHistory = new ProviderInputHistory();

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarProviderInterventions", "QueryScorer"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -174,7 +172,7 @@ class Node {
* up to you to filter the array to exclude scores above a certain threshold, or
* to take the top scorer, etc.
*/
class QueryScorer {
export class QueryScorer {
/**
* @param {number} distanceThreshold
* Edit distances no larger than this value are considered matches.
@ -749,7 +747,7 @@ class ProviderInterventions extends UrlbarProvider {
}
}
var UrlbarProviderInterventions = new ProviderInterventions();
export var UrlbarProviderInterventions = new ProviderInterventions();
/**
* Tip callbacks follow.

Просмотреть файл

@ -9,8 +9,6 @@
* extensions using the `omnibox` API.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderOmnibox"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -186,4 +184,4 @@ class ProviderOmnibox extends UrlbarProvider {
}
}
var UrlbarProviderOmnibox = new ProviderOmnibox();
export var UrlbarProviderOmnibox = new ProviderOmnibox();

Просмотреть файл

@ -9,8 +9,6 @@
* It is also used to register and unregister open tabs.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderOpenTabs"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -35,7 +33,7 @@ const PRIVATE_USER_CONTEXT_ID = -1;
/**
* Class used to create the provider.
*/
class UrlbarProviderOpenTabs extends UrlbarProvider {
export class UrlbarProviderOpenTabs extends UrlbarProvider {
constructor() {
super();
}

Просмотреть файл

@ -11,8 +11,6 @@
* This module exports a provider that providers results from the Places
* database, including history, bookmarks, and open tabs.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderPlaces"];
// Constants
// AutoComplete query type constants.
@ -1548,4 +1546,4 @@ class ProviderPlaces extends UrlbarProvider {
}
}
var UrlbarProviderPlaces = new ProviderPlaces();
export var UrlbarProviderPlaces = new ProviderPlaces();

Просмотреть файл

@ -10,8 +10,6 @@
* They can be both autofilled and provided as regular results.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderPreloadedSites"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -293,4 +291,4 @@ class ProviderPreloadedSites extends UrlbarProvider {
}
}
var UrlbarProviderPreloadedSites = new ProviderPreloadedSites();
export var UrlbarProviderPreloadedSites = new ProviderPreloadedSites();

Просмотреть файл

@ -8,8 +8,6 @@
* This module exports a provider returning a private search entry.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderPrivateSearch"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -132,4 +130,4 @@ class ProviderPrivateSearch extends UrlbarProvider {
}
}
var UrlbarProviderPrivateSearch = new ProviderPrivateSearch();
export var UrlbarProviderPrivateSearch = new ProviderPrivateSearch();

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarProviderQuickActions"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -231,4 +229,4 @@ class ProviderQuickActions extends UrlbarProvider {
}
}
var UrlbarProviderQuickActions = new ProviderQuickActions();
export var UrlbarProviderQuickActions = new ProviderQuickActions();

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarProviderQuickSuggest", "QUICK_SUGGEST_SOURCE"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -96,7 +94,7 @@ let TELEMETRY_IMPRESSION_CAP_EXTRA_KEYS = {
};
// Identifies the source of the QuickSuggest suggestion.
const QUICK_SUGGEST_SOURCE = {
export const QUICK_SUGGEST_SOURCE = {
REMOTE_SETTINGS: "remote-settings",
MERINO: "merino",
};
@ -1639,4 +1637,4 @@ class ProviderQuickSuggest extends UrlbarProvider {
_merinoSessionTimeoutMs = MERINO_SESSION_TIMEOUT_MS;
}
var UrlbarProviderQuickSuggest = new ProviderQuickSuggest();
export var UrlbarProviderQuickSuggest = new ProviderQuickSuggest();

Просмотреть файл

@ -8,8 +8,6 @@
* This module exports a provider that offers remote tabs.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderRemoteTabs"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -256,4 +254,4 @@ class ProviderRemoteTabs extends UrlbarProvider {
}
}
var UrlbarProviderRemoteTabs = new ProviderRemoteTabs();
export var UrlbarProviderRemoteTabs = new ProviderRemoteTabs();

Просмотреть файл

@ -8,8 +8,6 @@
* This module exports a provider that offers search engine suggestions.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderSearchSuggestions"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -500,4 +498,4 @@ function makeFormHistoryResult(queryContext, engine, entry) {
);
}
var UrlbarProviderSearchSuggestions = new ProviderSearchSuggestions();
export var UrlbarProviderSearchSuggestions = new ProviderSearchSuggestions();

Просмотреть файл

@ -9,8 +9,6 @@
* the newtab or starts an organic search with their default search engine.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderSearchTips"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -533,4 +531,4 @@ async function lastBrowserUpdateDate() {
return (await age.firstUse) || age.created;
}
var UrlbarProviderSearchTips = new ProviderSearchTips();
export var UrlbarProviderSearchTips = new ProviderSearchTips();

Просмотреть файл

@ -9,8 +9,6 @@
* typing a search engine domain.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderTabToSearch"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -491,5 +489,5 @@ function makeResult(context, engine, satisfiesAutofillThreshold = false) {
return result;
}
var UrlbarProviderTabToSearch = new ProviderTabToSearch();
export var UrlbarProviderTabToSearch = new ProviderTabToSearch();
initializeDynamicResult();

Просмотреть файл

@ -8,8 +8,6 @@
* This module exports a provider that offers token alias engines.
*/
var EXPORTED_SYMBOLS = ["UrlbarProviderTokenAliasEngines"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -232,4 +230,4 @@ class ProviderTokenAliasEngines extends UrlbarProvider {
}
}
var UrlbarProviderTokenAliasEngines = new ProviderTokenAliasEngines();
export var UrlbarProviderTokenAliasEngines = new ProviderTokenAliasEngines();

Просмотреть файл

@ -8,8 +8,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarProviderTopSites"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -378,4 +376,4 @@ class ProviderTopSites extends UrlbarProvider {
}
}
var UrlbarProviderTopSites = new ProviderTopSites();
export var UrlbarProviderTopSites = new ProviderTopSites();

Просмотреть файл

@ -8,8 +8,6 @@
* Provide unit converter.
*/
const EXPORTED_SYMBOLS = ["UrlbarProviderUnitConversion"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -189,4 +187,4 @@ class ProviderUnitConversion extends UrlbarProvider {
}
}
const UrlbarProviderUnitConversion = new ProviderUnitConversion();
export const UrlbarProviderUnitConversion = new ProviderUnitConversion();

Просмотреть файл

@ -9,8 +9,6 @@
* the connection between such providers and a UrlbarController.
*/
var EXPORTED_SYMBOLS = ["UrlbarProvidersManager"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -329,7 +327,7 @@ class ProvidersManager {
}
}
var UrlbarProvidersManager = new ProvidersManager();
export var UrlbarProvidersManager = new ProvidersManager();
/**
* Tracks a query status.

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
const EXPORTED_SYMBOLS = ["ONBOARDING_CHOICE", "UrlbarQuickSuggest"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -45,7 +43,7 @@ const DIALOG_VARIATION_PREF = "quickSuggestOnboardingDialogVariation";
// Values returned by the onboarding dialog depending on the user's response.
// These values are used in telemetry events, so be careful about changing them.
const ONBOARDING_CHOICE = {
export const ONBOARDING_CHOICE = {
ACCEPT_2: "accept_2",
CLOSE_1: "close_1",
DISMISS_1: "dismiss_1",
@ -562,4 +560,4 @@ class QuickSuggest extends EventEmitter {
}
}
let UrlbarQuickSuggest = new QuickSuggest();
export let UrlbarQuickSuggest = new QuickSuggest();

Просмотреть файл

@ -12,8 +12,6 @@
* the result types.
*/
var EXPORTED_SYMBOLS = ["UrlbarResult"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -29,7 +27,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
/**
* Class used to create a single result.
*/
class UrlbarResult {
export class UrlbarResult {
/**
* Creates a result.
* @param {integer} resultType one of UrlbarUtils.RESULT_TYPE.* values

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarSearchOneOffs"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -24,7 +22,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
/**
* The one-off search buttons in the urlbar.
*/
class UrlbarSearchOneOffs extends SearchOneOffs {
export class UrlbarSearchOneOffs extends SearchOneOffs {
/**
* Constructor.
*

Просмотреть файл

@ -11,8 +11,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarSearchUtils"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -356,4 +354,4 @@ class SearchUtils {
}
}
var UrlbarSearchUtils = new SearchUtils();
export var UrlbarSearchUtils = new SearchUtils();

Просмотреть файл

@ -10,8 +10,6 @@
* of UrlbarTokenizer.TYPE.
*/
var EXPORTED_SYMBOLS = ["UrlbarTokenizer"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -25,7 +23,7 @@ XPCOMUtils.defineLazyGetter(lazy, "logger", () =>
lazy.UrlbarUtils.getLogger({ prefix: "Tokenizer" })
);
var UrlbarTokenizer = {
export var UrlbarTokenizer = {
// Regex matching on whitespaces.
REGEXP_SPACES: /\s+/,
REGEXP_SPACES_START: /^\s+/,

Просмотреть файл

@ -9,16 +9,6 @@
* helper functions that are useful to all components of the urlbar.
*/
var EXPORTED_SYMBOLS = [
"L10nCache",
"SkippableTimer",
"TaskQueue",
"UrlbarMuxer",
"UrlbarProvider",
"UrlbarQueryContext",
"UrlbarUtils",
];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -44,7 +34,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
});
var UrlbarUtils = {
export var UrlbarUtils = {
// Extensions are allowed to add suggestions if they have registered a keyword
// with the omnibox API. This is the maximum number of suggestions an extension
// is allowed to add for a given search string using the omnibox API.
@ -1571,7 +1561,7 @@ UrlbarUtils.RESULT_PAYLOAD_SCHEMA = {
* It supplements it with details of how the search results should be obtained
* and what they consist of.
*/
class UrlbarQueryContext {
export class UrlbarQueryContext {
/**
* Constructs the UrlbarQueryContext instance.
*
@ -1754,7 +1744,7 @@ class UrlbarQueryContext {
* Base class for a muxer.
* The muxer scope is to sort a given list of results.
*/
class UrlbarMuxer {
export class UrlbarMuxer {
/**
* Unique name for the muxer, used by the context to sort results.
* Not using a unique name will cause the newest registration to win.
@ -1778,7 +1768,7 @@ class UrlbarMuxer {
* Base class for a provider.
* The provider scope is to query a datasource and return results from it.
*/
class UrlbarProvider {
export class UrlbarProvider {
constructor() {
XPCOMUtils.defineLazyGetter(this, "logger", () =>
UrlbarUtils.getLogger({ prefix: `Provider.${this.name}` })
@ -2057,7 +2047,7 @@ class UrlbarProvider {
* // Wait for the timer to have elapsed.
* await timer.promise;
*/
class SkippableTimer {
export class SkippableTimer {
/**
* Creates a skippable timer for the given callback and time.
* @param {object} options An object that configures the timer
@ -2150,7 +2140,7 @@ class SkippableTimer {
* only l10n strings with bare values but also strings that define attributes
* (e.g., ".label = My label value"). See `get` for details.
*/
class L10nCache {
export class L10nCache {
/**
* @param {Localization} l10n
* A `Localization` object like `document.l10n`. This class keeps a weak
@ -2349,7 +2339,7 @@ class L10nCache {
* of callbacks (or "tasks") where each callback is called and awaited in order,
* one at a time.
*/
class TaskQueue {
export class TaskQueue {
/**
* @returns {Promise}
* Resolves when the queue becomes empty. If the queue is already empty,

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarValueFormatter"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -22,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
* Applies URL highlighting and other styling to the text in the urlbar input,
* depending on the text.
*/
class UrlbarValueFormatter {
export class UrlbarValueFormatter {
/**
* @param {UrlbarInput} urlbarInput
*/

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
var EXPORTED_SYMBOLS = ["UrlbarView"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -50,7 +48,7 @@ function getUniqueId(prefix) {
/**
* Receives and displays address bar autocomplete results.
*/
class UrlbarView {
export class UrlbarView {
/**
* @param {UrlbarInput} input
* The UrlbarInput instance belonging to this UrlbarView instance.

Просмотреть файл

@ -12,49 +12,49 @@ DIRS += [
]
EXTRA_JS_MODULES += [
"QuickActionsLoaderDefault.jsm",
"UrlbarController.jsm",
"UrlbarEventBufferer.jsm",
"UrlbarInput.jsm",
"UrlbarMuxerUnifiedComplete.jsm",
"UrlbarPrefs.jsm",
"UrlbarProviderAboutPages.jsm",
"UrlbarProviderAliasEngines.jsm",
"UrlbarProviderAutofill.jsm",
"UrlbarProviderBookmarkKeywords.jsm",
"UrlbarProviderCalculator.jsm",
"UrlbarProviderExtension.jsm",
"UrlbarProviderHeuristicFallback.jsm",
"UrlbarProviderInputHistory.jsm",
"UrlbarProviderInterventions.jsm",
"UrlbarProviderOmnibox.jsm",
"UrlbarProviderOpenTabs.jsm",
"UrlbarProviderPlaces.jsm",
"UrlbarProviderPreloadedSites.jsm",
"UrlbarProviderPrivateSearch.jsm",
"UrlbarProviderQuickActions.jsm",
"UrlbarProviderQuickSuggest.jsm",
"UrlbarProviderRemoteTabs.jsm",
"UrlbarProviderSearchSuggestions.jsm",
"UrlbarProviderSearchTips.jsm",
"UrlbarProvidersManager.jsm",
"UrlbarProviderTabToSearch.jsm",
"UrlbarProviderTokenAliasEngines.jsm",
"UrlbarProviderTopSites.jsm",
"UrlbarProviderUnitConversion.jsm",
"UrlbarQuickSuggest.jsm",
"UrlbarResult.jsm",
"UrlbarSearchOneOffs.jsm",
"UrlbarSearchUtils.jsm",
"UrlbarTokenizer.jsm",
"UrlbarUtils.jsm",
"UrlbarValueFormatter.jsm",
"UrlbarView.jsm",
"QuickActionsLoaderDefault.sys.mjs",
"UrlbarController.sys.mjs",
"UrlbarEventBufferer.sys.mjs",
"UrlbarInput.sys.mjs",
"UrlbarMuxerUnifiedComplete.sys.mjs",
"UrlbarPrefs.sys.mjs",
"UrlbarProviderAboutPages.sys.mjs",
"UrlbarProviderAliasEngines.sys.mjs",
"UrlbarProviderAutofill.sys.mjs",
"UrlbarProviderBookmarkKeywords.sys.mjs",
"UrlbarProviderCalculator.sys.mjs",
"UrlbarProviderExtension.sys.mjs",
"UrlbarProviderHeuristicFallback.sys.mjs",
"UrlbarProviderInputHistory.sys.mjs",
"UrlbarProviderInterventions.sys.mjs",
"UrlbarProviderOmnibox.sys.mjs",
"UrlbarProviderOpenTabs.sys.mjs",
"UrlbarProviderPlaces.sys.mjs",
"UrlbarProviderPreloadedSites.sys.mjs",
"UrlbarProviderPrivateSearch.sys.mjs",
"UrlbarProviderQuickActions.sys.mjs",
"UrlbarProviderQuickSuggest.sys.mjs",
"UrlbarProviderRemoteTabs.sys.mjs",
"UrlbarProviderSearchSuggestions.sys.mjs",
"UrlbarProviderSearchTips.sys.mjs",
"UrlbarProvidersManager.sys.mjs",
"UrlbarProviderTabToSearch.sys.mjs",
"UrlbarProviderTokenAliasEngines.sys.mjs",
"UrlbarProviderTopSites.sys.mjs",
"UrlbarProviderUnitConversion.sys.mjs",
"UrlbarQuickSuggest.sys.mjs",
"UrlbarResult.sys.mjs",
"UrlbarSearchOneOffs.sys.mjs",
"UrlbarSearchUtils.sys.mjs",
"UrlbarTokenizer.sys.mjs",
"UrlbarUtils.sys.mjs",
"UrlbarValueFormatter.sys.mjs",
"UrlbarView.sys.mjs",
]
TESTING_JS_MODULES += [
"tests/quicksuggest/QuickSuggestTestUtils.jsm",
"tests/UrlbarTestUtils.jsm",
"tests/quicksuggest/QuickSuggestTestUtils.sys.mjs",
"tests/UrlbarTestUtils.sys.mjs",
]
BROWSER_CHROME_MANIFESTS += [
"tests/browser-tips/browser.ini",

Просмотреть файл

@ -3,8 +3,6 @@
"use strict";
const EXPORTED_SYMBOLS = ["UrlbarTestUtils"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -32,7 +30,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.jsm",
});
var UrlbarTestUtils = {
export var UrlbarTestUtils = {
/**
* This maps the categories used by the FX_URLBAR_SELECTED_RESULT_METHOD and
* FX_SEARCHBAR_SELECTED_RESULT_METHOD histograms to their indexes in the

Просмотреть файл

@ -3,8 +3,6 @@
"use strict";
const EXPORTED_SYMBOLS = ["QuickSuggestTestUtils"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
@ -806,4 +804,4 @@ class QSTestUtils {
}
}
var QuickSuggestTestUtils = new QSTestUtils();
export var QuickSuggestTestUtils = new QSTestUtils();

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
const EXPORTED_SYMBOLS = ["UnitConverterSimple"];
// NOTE: This units table need to be localized upon supporting multi locales
// since it supports en-US only.
// e.g. Should support plugada or funty as well for pound.
@ -172,7 +170,7 @@ const DECIMAL_PRECISION = 10;
/**
* This module converts simple unit such as angle and length.
*/
class UnitConverterSimple {
export class UnitConverterSimple {
/**
* Convert the given search string.
*

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
const EXPORTED_SYMBOLS = ["UnitConverterTemperature"];
const ABSOLUTE = ["celsius", "kelvin", "fahrenheit"];
const ALIAS = ["c", "k", "f"];
const UNITS = [...ABSOLUTE, ...ALIAS];
@ -25,7 +23,7 @@ const DECIMAL_PRECISION = 10;
/**
* This module converts temperature unit.
*/
class UnitConverterTemperature {
export class UnitConverterTemperature {
/**
* Convert the given search string.
*

Просмотреть файл

@ -4,8 +4,6 @@
"use strict";
const EXPORTED_SYMBOLS = ["UnitConverterTimezone"];
const TIMEZONES = {
IDLW: -12,
NT: -11,
@ -69,7 +67,7 @@ const KEYWORD_NOW = "NOW";
/**
* This module converts timezone.
*/
class UnitConverterTimezone {
export class UnitConverterTimezone {
/**
* Convert the given search string.
*

Просмотреть файл

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_JS_MODULES += [
"UnitConverterSimple.jsm",
"UnitConverterTemperature.jsm",
"UnitConverterTimezone.jsm",
"UnitConverterSimple.sys.mjs",
"UnitConverterTemperature.sys.mjs",
"UnitConverterTimezone.sys.mjs",
]