Sfoglia il codice sorgente

catch errors when trying read contentDocument

Gildas 7 anni fa
parent
commit
c2aed54e5d
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      lib/single-file/frame-tree.js

+ 6 - 1
lib/single-file/frame-tree.js

@@ -158,7 +158,12 @@ this.frameTree = this.frameTree || (() => {
 		const framesData = [];
 		frameElements.forEach((frameElement, frameIndex) => {
 			const windowId = parentWindowId + WINDOW_ID_SEPARATOR + frameIndex;
-			const frameDoc = frameElement.contentDocument;
+			let frameDoc;
+			try {
+				frameDoc = frameElement.contentDocument;
+			} catch (error) {
+				// ignored
+			}
 			if (frameDoc) {
 				try {
 					frameElement.contentWindow.stop();