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:
@@ -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 =
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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",
|
||||
});
|
||||
|
||||
|
||||
@@ -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",
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
});
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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",
|
||||
});
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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"
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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"];
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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": {
|
||||
@@ -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": {
|
||||
@@ -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"];
|
||||
@@ -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"];
|
||||
@@ -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'},
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
@@ -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.
|
||||
*
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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: {},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user