Jelajahi Sumber

fix missing frames when "load deferred images" is
disabled (fix #1202)

Gildas 2 tahun lalu
induk
melakukan
d27feaa249
1 mengubah file dengan 15 tambahan dan 15 penghapusan
  1. 15 15
      src/core/content/content.js

+ 15 - 15
src/core/content/content.js

@@ -159,20 +159,6 @@ async function processPage(options) {
 	};
 	const cancelProcessor = processor.cancel.bind(processor);
 	if (!options.saveRawPage) {
-		if (options.loadDeferredImages) {
-			const lazyLoadPromise = singlefile.processors.lazy.process(options);
-			ui.onLoadingDeferResources(options);
-			lazyLoadPromise.then(() => {
-				if (!processor.cancelled) {
-					ui.onLoadDeferResources(options);
-				}
-			});
-			if (options.loadDeferredImagesBeforeFrames) {
-				await lazyLoadPromise;
-			} else {
-				preInitializationPromises.push(lazyLoadPromise);
-			}
-		}
 		if (!options.removeFrames && frames && globalThis.frames) {
 			let frameTreePromise;
 			if (options.loadDeferredImages) {
@@ -198,9 +184,23 @@ async function processPage(options) {
 				preInitializationPromises.push(frameTreePromise);
 			}
 		}
+		if (options.loadDeferredImages) {
+			const lazyLoadPromise = singlefile.processors.lazy.process(options);
+			ui.onLoadingDeferResources(options);
+			lazyLoadPromise.then(() => {
+				if (!processor.cancelled) {
+					ui.onLoadDeferResources(options);
+				}
+			});
+			if (options.loadDeferredImagesBeforeFrames) {
+				await lazyLoadPromise;
+			} else {
+				preInitializationPromises.push(lazyLoadPromise);
+			}
+		}
 	}
 	if (!options.loadDeferredImagesBeforeFrames) {
-		[,options.frames] = await new Promise(resolve => {
+		[options.frames] = await new Promise(resolve => {
 			const preInitializationAllPromises = Promise.all(preInitializationPromises);
 			processor.cancel = function () {
 				cancelProcessor();