Explorar o código

removed removeNoScriptFrames function

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
83069f1aca
Modificáronse 1 ficheiros con 2 adicións e 14 borrados
  1. 2 14
      lib/single-file/single-file-core.js

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

@@ -423,8 +423,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		}
 
 		async frames(initialization) {
-			let frameElements = this.doc.querySelectorAll("iframe, frame, object[type=\"text/html\"][data]");
-			frameElements = DomUtil.removeNoScriptFrames(frameElements);
+			const frameElements = Array.from(this.doc.querySelectorAll("iframe, frame, object[type=\"text/html\"][data]"));
 			await Promise.all(frameElements.map(async (frameElement, frameIndex) => {
 				const frameWindowId = (this.options.windowId || "0") + "." + frameIndex;
 				const frameData = this.options.framesData.find(frame => frame.windowId == frameWindowId);
@@ -456,8 +455,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		}
 
 		async htmlImports(initialization) {
-			let linkElements = this.doc.querySelectorAll("link[rel=import][href]");
-			linkElements = DomUtil.removeNoScriptFrames(linkElements);
+			const linkElements = Array.from(this.doc.querySelectorAll("link[rel=import][href]"));
 			if (!this.relImportProcessors) {
 				this.relImportProcessors = new Map();
 			}
@@ -724,16 +722,6 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			}
 		}
 
-		static removeNoScriptFrames(frameElements) {
-			return Array.from(frameElements).filter(element => {
-				element = element.parentElement;
-				while (element && element.tagName != "NOSCRIPT") {
-					element = element.parentElement;
-				}
-				return !element;
-			});
-		}
-
 	}
 
 	return { getClass };