Преглед изворни кода

use Promise.all to wait for promises

Gildas пре 7 година
родитељ
комит
a5636c8d26
1 измењених фајлова са 1 додато и 1 уклоњено
  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) {