Przeglądaj źródła

moved cleanup code into removeDiscardedResources

Gildas 7 lat temu
rodzic
commit
06a8b8194f
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      lib/single-file/single-file-core.js

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

@@ -444,6 +444,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		}
 		}
 
 
 		removeDiscardedResources() {
 		removeDiscardedResources() {
+			this.doc.querySelectorAll("singlefile-infobar, singlefile-mask, singlefile-logs-window").forEach(element => element.remove());
 			const objectElements = this.doc.querySelectorAll("applet, meta[http-equiv=refresh], object[data]:not([type=\"image/svg+xml\"]):not([type=\"image/svg-xml\"]):not([type=\"text/html\"]), embed[src]:not([src*=\".svg\"])");
 			const objectElements = this.doc.querySelectorAll("applet, meta[http-equiv=refresh], object[data]:not([type=\"image/svg+xml\"]):not([type=\"image/svg-xml\"]):not([type=\"text/html\"]), embed[src]:not([src*=\".svg\"])");
 			this.stats.set("discarded", "objects", objectElements.length);
 			this.stats.set("discarded", "objects", objectElements.length);
 			this.stats.set("processed", "objects", objectElements.length);
 			this.stats.set("processed", "objects", objectElements.length);
@@ -491,7 +492,6 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		}
 		}
 
 
 		preProcessPage() {
 		preProcessPage() {
-			this.doc.querySelectorAll("singlefile-infobar, singlefile-mask, singlefile-logs-window").forEach(element => element.remove());
 			if (this.options.win) {
 			if (this.options.win) {
 				this.doc.body.querySelectorAll(":not(svg) title, meta, link[href][rel*=\"icon\"]").forEach(element => element instanceof this.options.win.HTMLElement && this.doc.head.appendChild(element));
 				this.doc.body.querySelectorAll(":not(svg) title, meta, link[href][rel*=\"icon\"]").forEach(element => element instanceof this.options.win.HTMLElement && this.doc.head.appendChild(element));
 			}
 			}