Преглед на файлове

catch errors when trying read contentDocument

Gildas преди 7 години
родител
ревизия
c2aed54e5d
променени са 1 файла, в които са добавени 6 реда и са изтрити 1 реда
  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();