Ver Fonte

use Promise.all to wait for promises

Gildas há 7 anos atrás
pai
commit
a5636c8d26
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      lib/single-file/single-file-core.js

+ 1 - 1
lib/single-file/single-file-core.js

@@ -678,7 +678,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			if (!this.options.removeVideoSrc) {
 				resourcePromises.push(DomProcessorHelper.processAttribute(this.doc, this.doc.querySelectorAll("video[src], video > source[src]"), "src", PREFIX_DATA_URI_VIDEO, this.baseURI, this.options, this.batchRequest));
 			}
-			await resourcePromises;
+			await Promise.all(resourcePromises);
 			if (this.options.removeAlternativeImages) {
 				let shortcutIcon = findShortcutIcon(Array.from(this.doc.querySelectorAll("link[href][rel=\"icon\"], link[href][rel=\"shortcut icon\"]")));
 				if (!shortcutIcon) {