diff --git a/browser/base/content/test/permissions/head.js b/browser/base/content/test/permissions/head.js index 3b93186080f6..962f15bc4c4d 100644 --- a/browser/base/content/test/permissions/head.js +++ b/browser/base/content/test/permissions/head.js @@ -4,7 +4,7 @@ const { PermissionTestUtils } = ChromeUtils.import( SpecialPowers.addTaskImport( "E10SUtils", - "resource://gre/modules/E10SUtils.jsm" + "resource://gre/modules/E10SUtils.sys.mjs" ); function openPermissionPopup() { diff --git a/testing/specialpowers/content/SpecialPowersChild.sys.mjs b/testing/specialpowers/content/SpecialPowersChild.sys.mjs index 0449c1094c9f..79933804605f 100644 --- a/testing/specialpowers/content/SpecialPowersChild.sys.mjs +++ b/testing/specialpowers/content/SpecialPowersChild.sys.mjs @@ -1649,7 +1649,7 @@ export class SpecialPowersChild extends JSWindowActorChild { } /** - * Automatically imports the given symbol from the given JSM for any + * Automatically imports the given symbol from the given sys.mjs for any * task spawned by this SpecialPowers instance. */ addTaskImport(symbol, url) { diff --git a/testing/specialpowers/content/SpecialPowersSandbox.sys.mjs b/testing/specialpowers/content/SpecialPowersSandbox.sys.mjs index cbeb02a237c3..1ad127636418 100644 --- a/testing/specialpowers/content/SpecialPowersSandbox.sys.mjs +++ b/testing/specialpowers/content/SpecialPowersSandbox.sys.mjs @@ -28,7 +28,7 @@ const SANDBOX_GLOBALS = [ "URL", ]; const EXTRA_IMPORTS = { - EventUtils: "resource://specialpowers/SpecialPowersEventUtils.jsm", + EventUtils: "resource://specialpowers/SpecialPowersEventUtils.sys.mjs", }; let expectFail = false; @@ -70,9 +70,10 @@ export class SpecialPowersSandbox { ...EXTRA_IMPORTS, ...opts.imports, }; - for (let [symbol, url] of Object.entries(imports)) { - ChromeUtils.defineModuleGetter(this.sandbox, symbol, url); - } + // We explicitly want these directly in the sandbox, and we aren't going + // to be using the globals within this file. + // eslint-disable-next-line mozilla/lazy-getter-object-name + ChromeUtils.defineESModuleGetters(this.sandbox, imports); // Note: When updating the set of globals exposed to sandboxes by // default, please also update the ESLint plugin rule defined in diff --git a/toolkit/components/narrate/test/head.js b/toolkit/components/narrate/test/head.js index 9eb95085d555..a69a9039fc0c 100644 --- a/toolkit/components/narrate/test/head.js +++ b/toolkit/components/narrate/test/head.js @@ -65,7 +65,7 @@ function spawnInNewReaderTab(url, func) { SpecialPowers.addTaskImport( "NarrateTestUtils", "chrome://mochitests/content/browser/" + - "toolkit/components/narrate/test/NarrateTestUtils.jsm" + "toolkit/components/narrate/test/NarrateTestUtils.sys.mjs" ); await SpecialPowers.spawn(browser, [], async function() { await NarrateTestUtils.getReaderReadyPromise(content);