Bug 1824608 - Convert toolkit/components/resistfingerprinting to ES modules. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D173659
This commit is contained in:
Saira Abdulla 2023-03-27 14:34:38 +00:00
Родитель 2646639210
Коммит 190fd21569
7 изменённых файлов: 11 добавлений и 22 удалений

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

@ -6,11 +6,9 @@
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const lazy = {};
ChromeUtils.defineModuleGetter(
lazy,
"RFPHelper",
"resource://gre/modules/RFPHelper.jsm"
);
ChromeUtils.defineESModuleGetters(lazy, {
RFPHelper: "resource://gre/modules/RFPHelper.sys.mjs",
});
const kPrefLetterboxing = "privacy.resistFingerprinting.letterboxing";

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

@ -50,6 +50,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
PublicSuffixList:
"resource://gre/modules/netwerk-dns/PublicSuffixList.sys.mjs",
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
RFPHelper: "resource://gre/modules/RFPHelper.sys.mjs",
RemoteSecuritySettings:
"resource://gre/modules/psm/RemoteSecuritySettings.sys.mjs",
@ -100,7 +101,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
PdfJs: "resource://pdf.js/PdfJs.jsm",
PluralForm: "resource://gre/modules/PluralForm.jsm",
ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
RFPHelper: "resource://gre/modules/RFPHelper.jsm",
SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
Sanitizer: "resource:///modules/Sanitizer.jsm",
SaveToPocket: "chrome://pocket/content/SaveToPocket.jsm",

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

@ -10,8 +10,8 @@
* example.
*/
const { RFPHelper } = ChromeUtils.import(
"resource://gre/modules/RFPHelper.jsm"
const { RFPHelper } = ChromeUtils.importESModule(
"resource://gre/modules/RFPHelper.sys.mjs"
);
// A set of test cases which defines the width and the height of the outer window.

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

@ -13020,7 +13020,7 @@
value: true
mirror: always
# The log level for browser console messages logged in RFPHelper.jsm. Change to
# The log level for browser console messages logged in RFPHelper.sys.mjs. Change to
# 'All' and restart to see the messages.
- name: privacy.resistFingerprinting.jsmloglevel
type: String

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

@ -2,13 +2,8 @@
/* 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";
var EXPORTED_SYMBOLS = ["RFPHelper"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
const kPrefResistFingerprinting = "privacy.resistFingerprinting";
const kPrefSpoofEnglish = "privacy.spoof_english";
@ -648,4 +643,4 @@ class _RFPHelper {
}
}
let RFPHelper = new _RFPHelper();
export let RFPHelper = new _RFPHelper();

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

@ -22,5 +22,5 @@ EXPORTS.mozilla += [
]
EXTRA_JS_MODULES += [
"RFPHelper.jsm",
"RFPHelper.sys.mjs",
]

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

@ -14,13 +14,9 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
GetClipboardSearchString: "resource://gre/modules/Finder.sys.mjs",
RFPHelper: "resource://gre/modules/RFPHelper.sys.mjs",
Rect: "resource://gre/modules/Geometry.sys.mjs",
});
ChromeUtils.defineModuleGetter(
lazy,
"RFPHelper",
"resource://gre/modules/RFPHelper.jsm"
);
const kPrefLetterboxing = "privacy.resistFingerprinting.letterboxing";