Bug 1816991 - ESMified installerprefs JSM. r=kpatenio

Differential Revision: https://phabricator.services.mozilla.com/D173316
This commit is contained in:
Bilal 2023-03-23 03:33:35 +00:00
Родитель 205211acee
Коммит 3195265a71
4 изменённых файлов: 7 добавлений и 13 удалений

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

@ -32,17 +32,13 @@ const INSTALLER_PREFS_BRANCH = "installer.";
// any others will be ignored. // any others will be ignored.
const INSTALLER_PREFS_LIST = ["installer.taskbarpin.win10.enabled"]; const INSTALLER_PREFS_LIST = ["installer.taskbarpin.win10.enabled"];
const { AppConstants } = ChromeUtils.importESModule( import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
"resource://gre/modules/AppConstants.sys.mjs" import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
);
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
// This constructor can take a list of prefs to override the default one, // This constructor can take a list of prefs to override the default one,
// but this is really only intended for tests to use. Normal usage should be // but this is really only intended for tests to use. Normal usage should be
// to leave the parameter omitted/undefined. // to leave the parameter omitted/undefined.
function InstallerPrefs(prefsList) { export function InstallerPrefs(prefsList) {
this.prefsList = prefsList || INSTALLER_PREFS_LIST; this.prefsList = prefsList || INSTALLER_PREFS_LIST;
// Each pref to be reflected will get a value created under this key, in HKCU. // Each pref to be reflected will get a value created under this key, in HKCU.
@ -144,5 +140,3 @@ InstallerPrefs.prototype = {
return key; return key;
}, },
}; };
var EXPORTED_SYMBOLS = ["InstallerPrefs"];

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

@ -8,7 +8,7 @@ Classes = [
{ {
'cid': '{cd8a6995-1f19-4cdd-9ed1-d6263302f594}', 'cid': '{cd8a6995-1f19-4cdd-9ed1-d6263302f594}',
'contract_ids': ['@mozilla.org/installerprefs;1'], 'contract_ids': ['@mozilla.org/installerprefs;1'],
'jsm': 'resource:///modules/InstallerPrefs.jsm', 'esModule': 'resource:///modules/InstallerPrefs.sys.mjs',
'constructor': 'InstallerPrefs', 'constructor': 'InstallerPrefs',
'categories': {'profile-after-change': 'InstallerPrefs'}, 'categories': {'profile-after-change': 'InstallerPrefs'},
'processes': ProcessSelector.MAIN_PROCESS_ONLY, 'processes': ProcessSelector.MAIN_PROCESS_ONLY,

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

@ -10,7 +10,7 @@ with Files("**"):
XPCSHELL_TESTS_MANIFESTS += ["test/unit/xpcshell.ini"] XPCSHELL_TESTS_MANIFESTS += ["test/unit/xpcshell.ini"]
EXTRA_JS_MODULES += [ EXTRA_JS_MODULES += [
"InstallerPrefs.jsm", "InstallerPrefs.sys.mjs",
] ]
XPCOM_MANIFESTS += [ XPCOM_MANIFESTS += [

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

@ -7,8 +7,8 @@ const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs" "resource://gre/modules/AppConstants.sys.mjs"
); );
const { InstallerPrefs } = ChromeUtils.import( const { InstallerPrefs } = ChromeUtils.importESModule(
"resource:///modules/InstallerPrefs.jsm" "resource:///modules/InstallerPrefs.sys.mjs"
); );
let gRegistryKeyPath = ""; let gRegistryKeyPath = "";