Bug 1802855 - Convert toolkit/components/satchel JSM modules to ES modules. r=credential-management-reviewers,daleharvey,sgalich

Differential Revision: https://phabricator.services.mozilla.com/D163201
This commit is contained in:
Mark Banner
2022-11-29 15:53:20 +00:00
parent 5d6cd66915
commit 319bc25bd8
37 changed files with 85 additions and 154 deletions

View File

@@ -2,22 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs",
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
SearchSuggestionController:
"resource://gre/modules/SearchSuggestionController.sys.mjs",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
});
const MAX_LOCAL_SUGGESTIONS = 3;
const MAX_SUGGESTIONS = 6;
const SEARCH_ENGINE_PLACEHOLDER_ICON =

View File

@@ -1,11 +1,8 @@
ChromeUtils.defineESModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
});
SearchTestUtils.init(this);
function getCertChainAsString(certBase64Array) {

View File

@@ -4,13 +4,13 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
ChromeUtils.defineESModuleGetters(this, {
Downloads: "resource://gre/modules/Downloads.sys.mjs",
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
Sanitizer: "resource:///modules/Sanitizer.sys.mjs",
SiteDataTestUtils: "resource://testing-common/SiteDataTestUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
PermissionTestUtils: "resource://testing-common/PermissionTestUtils.jsm",
});

View File

@@ -2,12 +2,8 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
ChromeUtils.defineModuleGetter(
this,
"FormHistory",
"resource://gre/modules/FormHistory.jsm"
);
ChromeUtils.defineESModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
});

View File

@@ -13,14 +13,10 @@ import {
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PropertyListUtils: "resource://gre/modules/PropertyListUtils.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"FormHistory",
"resource://gre/modules/FormHistory.jsm"
);
function Bookmarks(aBookmarksFile) {
this._file = aBookmarksFile;

View File

@@ -25,11 +25,9 @@ var formHistoryStartup = Cc[
"@mozilla.org/satchel/form-history-startup;1"
].getService(Ci.nsIObserver);
formHistoryStartup.observe(null, "profile-after-change", null);
ChromeUtils.defineModuleGetter(
this,
"FormHistory",
"resource://gre/modules/FormHistory.jsm"
);
ChromeUtils.defineESModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
});
var timeInMicroseconds = Date.now() * 1000;

View File

@@ -12,14 +12,11 @@
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
SearchSuggestionController:
"resource://gre/modules/SearchSuggestionController.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
});
/**
* Defines the search bar element.
*/

View File

@@ -1,6 +1,7 @@
/* eslint-disable mozilla/no-arbitrary-setTimeout */
XPCOMUtils.defineLazyModuleGetters(this, {
FormHistoryTestUtils: "resource://testing-common/FormHistoryTestUtils.jsm",
ChromeUtils.defineESModuleGetters(this, {
FormHistoryTestUtils:
"resource://testing-common/FormHistoryTestUtils.sys.mjs",
});
function expectedURL(aSearchTerms) {

View File

@@ -19,13 +19,11 @@ const TEST_ENGINE2 = {
const TEST_MSG = "ContentSearchUIControllerTest";
ChromeUtils.defineESModuleGetters(this, {
ContentSearch: "resource:///actors/ContentSearchParent.sys.mjs",
FormHistoryTestUtils:
"resource://testing-common/FormHistoryTestUtils.sys.mjs",
SearchSuggestionController:
"resource://gre/modules/SearchSuggestionController.sys.mjs",
ContentSearch: "resource:///actors/ContentSearchParent.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
FormHistoryTestUtils: "resource://testing-common/FormHistoryTestUtils.jsm",
});
const pageURL = getRootDirectory(gTestPath) + TEST_PAGE_BASENAME;

View File

@@ -2,6 +2,9 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
ChromeUtils.defineESModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
FormHistoryTestUtils:
"resource://testing-common/FormHistoryTestUtils.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs",
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
@@ -13,8 +16,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm",
CustomizableUITestUtils:
"resource://testing-common/CustomizableUITestUtils.jsm",
FormHistory: "resource://gre/modules/FormHistory.jsm",
FormHistoryTestUtils: "resource://testing-common/FormHistoryTestUtils.jsm",
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.jsm",
});

View File

@@ -2,14 +2,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs",
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.sys.mjs",
@@ -17,10 +16,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
UrlbarUtils: "resource:///modules/UrlbarUtils.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
});
const TELEMETRY_1ST_RESULT = "PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS";
const TELEMETRY_6_FIRST_RESULTS = "PLACES_AUTOCOMPLETE_6_FIRST_RESULTS_TIME_MS";

View File

@@ -12,14 +12,14 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
KeywordUtils: "resource://gre/modules/KeywordUtils.sys.mjs",
Log: "resource://gre/modules/Log.sys.mjs",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
SearchSuggestionController:
"resource://gre/modules/SearchSuggestionController.sys.mjs",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.sys.mjs",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.sys.mjs",
UrlbarSearchUtils: "resource:///modules/UrlbarSearchUtils.sys.mjs",
@@ -28,7 +28,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
XPCOMUtils.defineLazyModuleGetters(lazy, {
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
FormHistory: "resource://gre/modules/FormHistory.jsm",
});
export var UrlbarUtils = {

View File

@@ -14,6 +14,8 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
BrowserTestUtils: "resource://testing-common/BrowserTestUtils.sys.mjs",
FormHistoryTestUtils:
"resource://testing-common/FormHistoryTestUtils.sys.mjs",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
TestUtils: "resource://testing-common/TestUtils.sys.mjs",
UrlbarController: "resource:///modules/UrlbarController.sys.mjs",
@@ -26,7 +28,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm",
BrowserUIUtils: "resource:///modules/BrowserUIUtils.jsm",
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
FormHistoryTestUtils: "resource://testing-common/FormHistoryTestUtils.jsm",
});
export var UrlbarTestUtils = {

View File

@@ -1,8 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
XPCOMUtils.defineLazyModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
ChromeUtils.defineESModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
});
add_setup(async function() {

View File

@@ -10,13 +10,12 @@ import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
PrincipalsCollector: "resource://gre/modules/PrincipalsCollector.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
ContextualIdentityService:
"resource://gre/modules/ContextualIdentityService.jsm",
});

View File

@@ -22,11 +22,9 @@ const { Log } = ChromeUtils.importESModule(
"resource://gre/modules/Log.sys.mjs"
);
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"FormHistory",
"resource://gre/modules/FormHistory.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
});
const FORMS_TTL = 3 * 365 * 24 * 60 * 60; // Three years in seconds.

View File

@@ -1,5 +1,5 @@
const { FormHistory } = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"
const { FormHistory } = ChromeUtils.importESModule(
"resource://gre/modules/FormHistory.sys.mjs"
);
const { Service } = ChromeUtils.import("resource://services-sync/service.js");
const { Bookmark, BookmarkFolder, BookmarkQuery } = ChromeUtils.import(

View File

@@ -11,8 +11,8 @@ var EXPORTED_SYMBOLS = ["FormData"];
const { Logger } = ChromeUtils.import("resource://tps/logger.jsm");
const { FormHistory } = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"
const { FormHistory } = ChromeUtils.importESModule(
"resource://gre/modules/FormHistory.sys.mjs"
);
/**

View File

@@ -2,8 +2,9 @@
* Test capture popup notifications
*/
XPCOMUtils.defineLazyModuleGetters(this, {
FormHistoryTestUtils: "resource://testing-common/FormHistoryTestUtils.jsm",
ChromeUtils.defineESModuleGetters(this, {
FormHistoryTestUtils:
"resource://testing-common/FormHistoryTestUtils.sys.mjs",
});
const BRAND_BUNDLE = Services.strings.createBundle(

View File

@@ -3,8 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
function isAutocompleteDisabled(aField) {
if (aField.autocomplete !== "") {
return aField.autocomplete === "off";
@@ -172,7 +170,7 @@ FormHistoryClient.prototype = {
FormHistoryClient.nextRequestID = 1;
function FormAutoComplete() {
export function FormAutoComplete() {
this.init();
}
@@ -505,8 +503,8 @@ FormAutoComplete.prototype = {
// that we use the one defined here. To get around that, we explicitly
// import the module here, out of the way of the other uses of
// FormAutoCompleteResult.
let { FormAutoCompleteResult } = ChromeUtils.import(
"resource://gre/modules/nsFormAutoCompleteResult.jsm"
let { FormAutoCompleteResult } = ChromeUtils.importESModule(
"resource://gre/modules/nsFormAutoCompleteResult.sys.mjs"
);
return new FormAutoCompleteResult(
datalistResult.searchString,
@@ -675,5 +673,3 @@ FormAutoCompleteResult.prototype = {
this.client.remove(removedEntry.text, removedEntry.guid);
},
};
var EXPORTED_SYMBOLS = ["FormAutoComplete"];

View File

@@ -1,7 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* FormHistory
@@ -82,12 +81,9 @@
* record that should be updated.
*/
const EXPORTED_SYMBOLS = ["FormHistory"];
let FormHistory;
export let FormHistory;
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const lazy = {};

View File

@@ -2,13 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["FormHistoryChild"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
@@ -38,7 +32,7 @@ function log(message) {
Services.console.logStringMessage("satchelFormListener: " + message);
}
class FormHistoryChild extends JSWindowActorChild {
export class FormHistoryChild extends JSWindowActorChild {
handleEvent(event) {
switch (event.type) {
case "DOMFormBeforeSubmit": {

View File

@@ -2,19 +2,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["FormHistoryParent"];
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"FormHistory",
"resource://gre/modules/FormHistory.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
});
class FormHistoryParent extends JSWindowActorParent {
export class FormHistoryParent extends JSWindowActorParent {
receiveMessage(message) {
switch (message.name) {
case "FormHistory:FormSubmitEntries": {

View File

@@ -4,13 +4,11 @@
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"FormHistory",
"resource://gre/modules/FormHistory.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
});
function FormHistoryStartup() {}
export function FormHistoryStartup() {}
FormHistoryStartup.prototype = {
classID: Components.ID("{3A0012EB-007F-4BB8-AA81-A07385F77A25}"),
@@ -96,5 +94,3 @@ FormHistoryStartup.prototype = {
}
},
};
var EXPORTED_SYMBOLS = ["FormHistoryStartup"];

View File

@@ -2,11 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { FormAutoCompleteResult } = ChromeUtils.import(
"resource://gre/modules/nsFormAutoCompleteResult.jsm"
);
import { FormAutoCompleteResult } from "resource://gre/modules/nsFormAutoCompleteResult.sys.mjs";
function InputListAutoComplete() {}
export function InputListAutoComplete() {}
InputListAutoComplete.prototype = {
classID: Components.ID("{bf1e01d0-953e-11df-981c-0800200c9a66}"),
@@ -64,5 +62,3 @@ InputListAutoComplete.prototype = {
return items;
},
};
var EXPORTED_SYMBOLS = ["InputListAutoComplete"];

View File

@@ -20,19 +20,19 @@ Classes = [
{
'cid': '{c11c21b2-71c9-4f87-a0f8-5e13f50495fd}',
'contract_ids': ['@mozilla.org/satchel/form-autocomplete;1'],
'jsm': 'resource://gre/modules/FormAutoComplete.jsm',
'esModule': 'resource://gre/modules/FormAutoComplete.sys.mjs',
'constructor': 'FormAutoComplete',
},
{
'cid': '{bf1e01d0-953e-11df-981c-0800200c9a66}',
'contract_ids': ['@mozilla.org/satchel/inputlist-autocomplete;1'],
'jsm': 'resource://gre/modules/InputListAutoComplete.jsm',
'esModule': 'resource://gre/modules/InputListAutoComplete.sys.mjs',
'constructor': 'InputListAutoComplete',
},
{
'cid': '{3a0012eb-007f-4bb8-aa81-a07385f77a25}',
'contract_ids': ['@mozilla.org/satchel/form-history-startup;1'],
'jsm': 'resource://gre/modules/FormHistoryStartup.jsm',
'esModule': 'resource://gre/modules/FormHistoryStartup.sys.mjs',
'constructor': 'FormHistoryStartup',
'categories': {'profile-after-change': 'formHistoryStartup'},
},

View File

@@ -28,11 +28,11 @@ LOCAL_INCLUDES += [
]
EXTRA_JS_MODULES += [
"FormAutoComplete.jsm",
"FormHistory.jsm",
"FormHistoryStartup.jsm",
"InputListAutoComplete.jsm",
"nsFormAutoCompleteResult.jsm",
"FormAutoComplete.sys.mjs",
"FormHistory.sys.mjs",
"FormHistoryStartup.sys.mjs",
"InputListAutoComplete.sys.mjs",
"nsFormAutoCompleteResult.sys.mjs",
]
XPCOM_MANIFESTS += [
@@ -40,14 +40,14 @@ XPCOM_MANIFESTS += [
]
TESTING_JS_MODULES += [
"test/FormHistoryTestUtils.jsm",
"test/FormHistoryTestUtils.sys.mjs",
]
include("/ipc/chromium/chromium-config.mozbuild")
FINAL_TARGET_FILES.actors += [
"FormHistoryChild.jsm",
"FormHistoryParent.jsm",
"FormHistoryChild.sys.mjs",
"FormHistoryParent.sys.mjs",
]
FINAL_LIBRARY = "xul"

View File

@@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var EXPORTED_SYMBOLS = ["FormAutoCompleteResult"];
function FormAutoCompleteResult(
export function FormAutoCompleteResult(
searchString,
searchResult,
defaultIndex,

View File

@@ -1,18 +1,10 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const EXPORTED_SYMBOLS = ["FormHistoryTestUtils"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
ChromeUtils.defineESModuleGetters(lazy, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
});
/**
@@ -22,7 +14,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
* additions and check, thus further changes may be necessary for different
* use-cases.
*/
var FormHistoryTestUtils = {
export var FormHistoryTestUtils = {
/**
* Adds values to form history.
*

View File

@@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { FormHistory } = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"
const { FormHistory } = ChromeUtils.importESModule(
"resource://gre/modules/FormHistory.sys.mjs"
);
add_task(async function test() {

View File

@@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { FormHistory } = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"
const { FormHistory } = ChromeUtils.importESModule(
"resource://gre/modules/FormHistory.sys.mjs"
);
add_task(async function test() {

View File

@@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var { FormHistory } = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"
var { FormHistory } = ChromeUtils.importESModule(
"resource://gre/modules/FormHistory.sys.mjs"
);
/** Test for Bug 472396 */

View File

@@ -1,7 +1,7 @@
/* eslint-env mozilla/chrome-script */
const { FormHistory } = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"
const { FormHistory } = ChromeUtils.importESModule(
"resource://gre/modules/FormHistory.sys.mjs"
);
const { ContentTaskUtils } = ChromeUtils.importESModule(
"resource://testing-common/ContentTaskUtils.sys.mjs"

View File

@@ -17,14 +17,12 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
);
ChromeUtils.defineESModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
FormHistoryTestUtils:
"resource://testing-common/FormHistoryTestUtils.sys.mjs",
Sqlite: "resource://gre/modules/Sqlite.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(this, {
FormHistory: "resource://gre/modules/FormHistory.jsm",
FormHistoryTestUtils: "resource://testing-common/FormHistoryTestUtils.jsm",
});
do_get_profile();
// Send the profile-after-change notification to the form history component to ensure

View File

@@ -2,9 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const { FormAutoCompleteResult } = ChromeUtils.import(
"resource://gre/modules/nsFormAutoCompleteResult.jsm"
);
import { FormAutoCompleteResult } from "resource://gre/modules/nsFormAutoCompleteResult.sys.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
SearchSuggestionController:

View File

@@ -11,8 +11,8 @@
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
const { FormHistory } = ChromeUtils.import(
"resource://gre/modules/FormHistory.jsm"
const { FormHistory } = ChromeUtils.importESModule(
"resource://gre/modules/FormHistory.sys.mjs"
);
const { SearchSuggestionController } = ChromeUtils.importESModule(
"resource://gre/modules/SearchSuggestionController.sys.mjs"

View File

@@ -268,10 +268,10 @@ let JSWINDOWACTORS = {
FormHistory: {
parent: {
moduleURI: "resource://gre/actors/FormHistoryParent.jsm",
esModuleURI: "resource://gre/actors/FormHistoryParent.sys.mjs",
},
child: {
moduleURI: "resource://gre/actors/FormHistoryChild.jsm",
esModuleURI: "resource://gre/actors/FormHistoryChild.sys.mjs",
events: {
DOMFormBeforeSubmit: {},
},