Procházet zdrojové kódy

do not reset zoom level when processing the page in background (fix #544)

Gildas před 5 roky
rodič
revize
0e5668aa2e
1 změnil soubory, kde provedl 2 přidání a 4 odebrání
  1. 2 4
      lib/single-file/index.js

+ 2 - 4
lib/single-file/index.js

@@ -67,10 +67,8 @@ this.singlefile = this.singlefile || {
 			options.insertSingleFileComment = true;
 			options.insertCanonicalLink = true;
 			options.onprogress = event => {
-				if (event.type === event.RESOURCES_INITIALIZED) {
-					if (options.loadDeferredImages) {
-						this.processors.lazy.content.loader.resetZoomLevel(options);
-					}
+				if (event.type === event.RESOURCES_INITIALIZED && doc && window && options.loadDeferredImages) {
+					this.processors.lazy.content.loader.resetZoomLevel(options);
 				}
 			};
 			const processor = new this.SingleFile(options);