Selaa lähdekoodia

always empty src frame before processing them

Gildas 7 vuotta sitten
vanhempi
sitoutus
67b422d0c0
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      lib/single-file/single-file-core.js

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

@@ -550,11 +550,11 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		async frames(initialization) {
 		async frames(initialization) {
 			const frameElements = Array.from(this.doc.querySelectorAll("iframe, 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 => {
 			await Promise.all(frameElements.map(async frameElement => {
+				DomProcessorHelper.setFrameEmptySrc(frameElement);
+				frameElement.setAttribute("sandbox", "");
 				const frameWindowId = frameElement.getAttribute(WIN_ID_ATTRIBUTE_NAME);
 				const frameWindowId = frameElement.getAttribute(WIN_ID_ATTRIBUTE_NAME);
 				if (frameWindowId) {
 				if (frameWindowId) {
 					const frameData = this.options.framesData.find(frame => frame.windowId == frameWindowId);
 					const frameData = this.options.framesData.find(frame => frame.windowId == frameWindowId);
-					DomProcessorHelper.setFrameEmptySrc(frameElement);
-					frameElement.setAttribute("sandbox", "");
 					if (frameData) {
 					if (frameData) {
 						if (initialization) {
 						if (initialization) {
 							const options = Object.create(this.options);
 							const options = Object.create(this.options);