From 1a3ea508fe12ed8e1683250c929ae7220888c4be Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 25 Aug 2025 14:22:29 -0400 Subject: [PATCH] Preferences: Add getScope() function --- chrome/content/zotero/preferences/preferences.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index 98e6675e69..b18c1ca784 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -140,6 +140,17 @@ var Zotero_Preferences = { } }, + /** + * Get the scope object for a pane by its ID. + * A pane's scope contains the top-level variables defined by its scripts. + * + * @param {string} paneID + * @returns {Cu.Sandbox | null} + */ + getScope(paneID) { + return this.panes.get(paneID)?.scope ?? null; + }, + async _handleNavigationMouseOver(event) { if (event.target.tagName === 'richlistitem') { await this._loadPane(event.target.value);