From cd813171e7d29b164d3760698274790e888c8fbb Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 2 Jul 2025 15:49:20 -0400 Subject: [PATCH] Don't rely on hiddenDOMWindow in plugins.js --- chrome/content/zotero/xpcom/plugins.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/plugins.js b/chrome/content/zotero/xpcom/plugins.js index f9e87a888f..313837fc0c 100644 --- a/chrome/content/zotero/xpcom/plugins.js +++ b/chrome/content/zotero/xpcom/plugins.js @@ -339,7 +339,15 @@ Zotero.Plugins = new function () { */ this.getIconURI = async function (id, idealSize) { var addon = await AddonManager.getAddonByID(id); - return AddonManager.getPreferredIconURL(addon, idealSize, Services.appShell.hiddenDOMWindow); + return AddonManager.getPreferredIconURL( + addon, + idealSize, + // This window argument is optional, only used for determining + // whether to get the hiDPI icon. + // Use the main window (which we always have, except on non-macOS), + // falling back to the hidden window (which we always have on macOS). + Zotero.getMainWindow() || Services.appShell.hiddenDOMWindow + ); };