diff --git a/testTranslators/testTranslators.js b/testTranslators/testTranslators.js index e28f655..5ed19f0 100644 --- a/testTranslators/testTranslators.js +++ b/testTranslators/testTranslators.js @@ -425,6 +425,7 @@ async function init() { allOutputView = new OutputView(); allOutputView.setDisplayed(true); + const whenReadyToRun = []; await Promise.all(TRANSLATOR_TYPES.map(async displayType => { let translatorType = displayType.toLowerCase(); @@ -474,7 +475,7 @@ async function init() { // get translators, with code for unsupported translators if(!viewerMode) { let translators = await Zotero.Translators.getAllForType(translatorType, true); - haveTranslators(translators, translatorType); + whenReadyToRun.push(haveTranslators(translators, translatorType)); } })); @@ -531,6 +532,7 @@ async function init() { translatorBox.appendChild(lastP); // Run translators specified in the hash params if any + await Promise.all(whenReadyToRun); runURLSpecifiedTranslators(); } } @@ -650,4 +652,4 @@ function serializeToDownload(e) { e.preventDefault(); } -window.addEventListener("load", load, false); \ No newline at end of file +window.addEventListener("load", load, false);