Quellcode durchsuchen

fixed removal of singlefile attribute in ignored iframes

Gildas vor 5 Jahren
Ursprung
Commit
7c3ea7b923
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 3 2
      lib/single-file/single-file-core.js

+ 3 - 2
lib/single-file/single-file-core.js

@@ -1209,14 +1209,14 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 
 		async processFrames() {
 			if (this.options.frames) {
-				const frameElements = Array.from(this.doc.querySelectorAll("iframe:not([" + util.HIDDEN_FRAME_ATTRIBUTE_NAME + "]), frame, object[type=\"text/html\"][data]"));
+				const frameElements = Array.from(this.doc.querySelectorAll("iframe, frame, object[type=\"text/html\"][data]"));
 				await Promise.all(frameElements.map(async frameElement => {
 					const frameWindowId = frameElement.getAttribute(util.WIN_ID_ATTRIBUTE_NAME);
 					if (frameWindowId) {
 						const frameData = this.options.frames.find(frame => frame.windowId == frameWindowId);
 						if (frameData) {
 							this.options.frames = this.options.frames.filter(frame => frame.windowId != frameWindowId);
-							if (frameData.runner) {
+							if (frameData.runner && frameElement.getAttribute(util.HIDDEN_FRAME_ATTRIBUTE_NAME) != "") {
 								this.stats.add("processed", "frames", 1);
 								await frameData.runner.run();
 								const pageData = await frameData.runner.getPageData();
@@ -1238,6 +1238,7 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
 								}
 								this.stats.addAll(pageData);
 							} else {
+								frameElement.removeAttribute(util.WIN_ID_ATTRIBUTE_NAME);
 								this.stats.add("discarded", "frames", 1);
 							}
 						}