From ffd6a988e138f1bf0fd00de4a0b6e8ac7c4201b4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 12 Jun 2023 01:33:27 -0400 Subject: [PATCH] Await plugin bootstrap methods --- chrome/content/zotero/xpcom/plugins.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/plugins.js b/chrome/content/zotero/xpcom/plugins.js index 56842e2f99..e0b4145885 100644 --- a/chrome/content/zotero/xpcom/plugins.js +++ b/chrome/content/zotero/xpcom/plugins.js @@ -143,6 +143,10 @@ Zotero.Plugins = new function () { let result; try { result = func.call(scope, params, reason); + // If bootstrap method returns a promise, wait for it + if (result && result.then) { + await result; + } } catch (e) { Zotero.logError(`Error running bootstrap method '${method}' on ${id}`);