Переглянути джерело

call stop on windows before retrieving contents

Gildas 7 роки тому
батько
коміт
26ae2bccd6
1 змінених файлів з 2 додано та 0 видалено
  1. 2 0
      lib/single-file/frame-tree.js

+ 2 - 0
lib/single-file/frame-tree.js

@@ -45,6 +45,7 @@ this.frameTree = this.frameTree || (() => {
 		if (typeof event.data == "string" && event.data.startsWith(MESSAGE_PREFIX)) {
 			const message = JSON.parse(event.data.substring(MESSAGE_PREFIX.length));
 			if (message.method == INIT_REQUEST_MESSAGE) {
+				window.stop();
 				initRequest(message);
 			} else if (message.method == INIT_RESPONSE_MESSAGE) {
 				const port = event.ports[0];
@@ -158,6 +159,7 @@ this.frameTree = this.frameTree || (() => {
 			const frameDoc = frameElement.contentDocument;
 			if (frameDoc) {
 				try {
+					frameElement.contentWindow.stop();
 					processFrames(frameDoc.querySelectorAll(FRAMES_CSS_SELECTOR), options, windowId, sessionId);
 					framesData.push(getFrameData(frameDoc, frameElement.contentWindow, windowId, options));
 				} catch (error) {