From eeb94aea48068b2eca35cb08e798690f99d8d266 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 30 Jun 2025 19:06:07 -0400 Subject: [PATCH] fx140: Fix more broken code --- chrome/content/zotero/HiddenBrowser.mjs | 3 +-- chrome/content/zotero/actors/ActorManager.mjs | 3 +++ chrome/content/zotero/elements/abstractBox.js | 2 +- chrome/content/zotero/standalone/standalone.js | 2 +- chrome/content/zotero/xpcom/data/feeds.js | 5 +++-- chrome/content/zotero/xpcom/zotero.js | 5 ++--- chrome/content/zotero/zoteroPane.js | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/chrome/content/zotero/HiddenBrowser.mjs b/chrome/content/zotero/HiddenBrowser.mjs index d0f0322d86..03b05e4a42 100644 --- a/chrome/content/zotero/HiddenBrowser.mjs +++ b/chrome/content/zotero/HiddenBrowser.mjs @@ -26,8 +26,7 @@ const { BlockingObserver } = ChromeUtils.importESModule("chrome://zotero/content/BlockingObserver.mjs"); -// TODO: Fx140: Migrate actors and re-enable -// ChromeUtils.importESModule("chrome://zotero/content/actors/ActorManager.mjs"); +ChromeUtils.importESModule("chrome://zotero/content/actors/ActorManager.mjs"); /* global HiddenFrame, E10SUtils */ ChromeUtils.defineESModuleGetters(globalThis, { diff --git a/chrome/content/zotero/actors/ActorManager.mjs b/chrome/content/zotero/actors/ActorManager.mjs index 05696789a2..8bf345a797 100644 --- a/chrome/content/zotero/actors/ActorManager.mjs +++ b/chrome/content/zotero/actors/ActorManager.mjs @@ -1,6 +1,8 @@ // Register Mozilla actors import "resource://gre/modules/ActorManagerParent.sys.mjs"; +// TODO: Fx140: Migrate actors and re-enable +if(false) { ChromeUtils.registerWindowActor("PageData", { child: { moduleURI: "chrome://zotero/content/actors/PageDataChild.jsm" @@ -90,3 +92,4 @@ ChromeUtils.registerWindowActor("DocumentIsReady", { moduleURI: "chrome://zotero/content/actors/DocumentIsReadyChild.jsm" } }); +} diff --git a/chrome/content/zotero/elements/abstractBox.js b/chrome/content/zotero/elements/abstractBox.js index 8b32bd4aaa..f5bd62d954 100644 --- a/chrome/content/zotero/elements/abstractBox.js +++ b/chrome/content/zotero/elements/abstractBox.js @@ -26,7 +26,7 @@ "use strict"; { - ChromeUtils.import("chrome://zotero/content/actors/ActorManager.jsm"); + ChromeUtils.importESModule("chrome://zotero/content/actors/ActorManager.mjs"); const SANDBOX_ALL_FLAGS = 0xFFFFF; diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js index 65e739a599..a5741467a1 100644 --- a/chrome/content/zotero/standalone/standalone.js +++ b/chrome/content/zotero/standalone/standalone.js @@ -86,7 +86,7 @@ const ZoteroStandalone = new function () { if(!Zotero) { throw true; } - if(Zotero.initializationPromise.isPending()) { + if(!Zotero.initialized) { Zotero.showZoteroPaneProgressMeter(); } return Zotero.initializationPromise; diff --git a/chrome/content/zotero/xpcom/data/feeds.js b/chrome/content/zotero/xpcom/data/feeds.js index bfa1bfb16c..7b60971b9f 100644 --- a/chrome/content/zotero/xpcom/data/feeds.js +++ b/chrome/content/zotero/xpcom/data/feeds.js @@ -32,11 +32,12 @@ Zotero.Feeds = new function () { this.init = function () { // Delay initialization for tests - _initPromise = Zotero.Schema.schemaUpdatePromise.delay(5000) - .then(() => { + _initPromise = Zotero.Schema.schemaUpdatePromise + .then(async () => { // Don't run feed checks randomly during tests if (Zotero.test) return; + await Zotero.Promise.delay(5000); return this.scheduleNextFeedCheck(); }) .then(() => _initPromise = null); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 63ef68ebfe..15120cae02 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -730,14 +730,13 @@ const { CommandLineOptions } = ChromeUtils.importESModule("chrome://zotero/conte // Load all library data except for items, which are loaded when libraries are first // clicked on or if otherwise necessary - await // FIXME: fx140: replace call to Zotero.Promise.each() - Zotero.Promise.each(Zotero.Libraries.getAll(), library => (async function () { + await Array.fromAsync(Zotero.Libraries.getAll(), async (library) => { await Zotero.SyncedSettings.loadAll(library.libraryID); if (library.libraryType != 'feed') { await Zotero.Collections.loadAll(library.libraryID); await Zotero.Searches.loadAll(library.libraryID); } - })()); + }); // Migrate fields from Extra that can be moved to item fields after a schema update await Zotero.Schema.migrateExtraFields(); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index d6b7e0549b..c6494bf967 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -23,6 +23,7 @@ ***** END LICENSE BLOCK ***** */ +const { ZOTERO_CONFIG } = ChromeUtils.importESModule('resource://zotero/config.mjs'); var { FilePicker } = ChromeUtils.importESModule('chrome://zotero/content/modules/filePicker.mjs'); /* @@ -135,7 +136,6 @@ var ZoteroPane = new function () { } // Set the sync tooltip label - Cu.import("resource://zotero/config.js"); let syncLabel = document.getElementById('zotero-tb-sync-label'); syncLabel.value = Zotero.getString('sync.syncWith', ZOTERO_CONFIG.DOMAIN_NAME); let syncButton = document.querySelector("#zotero-tb-sync");