From be0cc2c602615b1fe3556e38c6f7fb4fa644ddee Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 2 Jul 2025 11:15:58 -0400 Subject: [PATCH] fx140: Fix ChromeUtils.defineESModuleGetters(this, ...) in MJS files `this` is undefined - use globalThis. --- chrome/content/zotero/EPUB.mjs | 2 +- chrome/content/zotero/actors/ExternalLinkHandlerParent.mjs | 2 +- chrome/content/zotero/actors/FeedAbstractParent.mjs | 2 +- chrome/content/zotero/actors/MendeleyAuthParent.mjs | 2 +- chrome/content/zotero/actors/ZoteroPrintParent.mjs | 7 +------ 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/chrome/content/zotero/EPUB.mjs b/chrome/content/zotero/EPUB.mjs index 631cc348bc..31ba38a34b 100644 --- a/chrome/content/zotero/EPUB.mjs +++ b/chrome/content/zotero/EPUB.mjs @@ -23,7 +23,7 @@ ***** END LICENSE BLOCK ***** */ -ChromeUtils.defineESModuleGetters(this, { +ChromeUtils.defineESModuleGetters(globalThis, { Zotero: "chrome://zotero/content/zotero.mjs", }); diff --git a/chrome/content/zotero/actors/ExternalLinkHandlerParent.mjs b/chrome/content/zotero/actors/ExternalLinkHandlerParent.mjs index 394d495065..be88e19ee0 100644 --- a/chrome/content/zotero/actors/ExternalLinkHandlerParent.mjs +++ b/chrome/content/zotero/actors/ExternalLinkHandlerParent.mjs @@ -1,4 +1,4 @@ -ChromeUtils.defineESModuleGetters(this, { +ChromeUtils.defineESModuleGetters(globalThis, { Zotero: "chrome://zotero/content/zotero.mjs" }); diff --git a/chrome/content/zotero/actors/FeedAbstractParent.mjs b/chrome/content/zotero/actors/FeedAbstractParent.mjs index c6470371e6..a7411cd05b 100644 --- a/chrome/content/zotero/actors/FeedAbstractParent.mjs +++ b/chrome/content/zotero/actors/FeedAbstractParent.mjs @@ -1,4 +1,4 @@ -ChromeUtils.defineESModuleGetters(this, { +ChromeUtils.defineESModuleGetters(globalThis, { Zotero: "chrome://zotero/content/zotero.mjs" }); diff --git a/chrome/content/zotero/actors/MendeleyAuthParent.mjs b/chrome/content/zotero/actors/MendeleyAuthParent.mjs index 8bc57b41e3..7baeda67bf 100644 --- a/chrome/content/zotero/actors/MendeleyAuthParent.mjs +++ b/chrome/content/zotero/actors/MendeleyAuthParent.mjs @@ -1,6 +1,6 @@ /* global JSWindowActorParent:false */ -ChromeUtils.defineESModuleGetters(this, { +ChromeUtils.defineESModuleGetters(globalThis, { Zotero: "chrome://zotero/content/zotero.mjs" }); diff --git a/chrome/content/zotero/actors/ZoteroPrintParent.mjs b/chrome/content/zotero/actors/ZoteroPrintParent.mjs index 7ca43b774d..baace42a10 100644 --- a/chrome/content/zotero/actors/ZoteroPrintParent.mjs +++ b/chrome/content/zotero/actors/ZoteroPrintParent.mjs @@ -1,9 +1,4 @@ -import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; - -XPCOMUtils.defineLazyModuleGetters(this, { -}); - -ChromeUtils.defineESModuleGetters(this, { +ChromeUtils.defineESModuleGetters(globalThis, { Zotero: "chrome://zotero/content/zotero.mjs", });