|
|
@@ -98,29 +98,29 @@ this.frameTree = this.frameTree || (() => {
|
|
|
}
|
|
|
let framesData = [];
|
|
|
frameElements.forEach((frameElement, frameIndex) => {
|
|
|
- const frameWinId = windowId + "." + frameIndex;
|
|
|
- frameElement.setAttribute(docHelper.WIN_ID_ATTRIBUTE_NAME, frameWinId);
|
|
|
- framesData.push({ windowId: frameWinId });
|
|
|
+ const frameWindowId = windowId + "." + frameIndex;
|
|
|
+ frameElement.setAttribute(docHelper.WIN_ID_ATTRIBUTE_NAME, frameWindowId);
|
|
|
+ framesData.push({ windowId: frameWindowId });
|
|
|
if (!frameElement.contentDocument) {
|
|
|
try {
|
|
|
- frameElement.contentWindow.postMessage(MESSAGE_PREFIX + "::" + JSON.stringify({ method: "initRequest", windowId: frameWinId, sessionId, options }), "*");
|
|
|
+ frameElement.contentWindow.postMessage(MESSAGE_PREFIX + "::" + JSON.stringify({ method: "initRequest", windowId: frameWindowId, sessionId, options }), "*");
|
|
|
} catch (error) {
|
|
|
/* ignored */
|
|
|
}
|
|
|
}
|
|
|
- timeout.set(() => top.postMessage(MESSAGE_PREFIX + "::" + JSON.stringify({ method: "initResponse", framesData: [{ windowId: frameWinId, processed: true }], windowId: frameWinId, sessionId }), "*"), TIMEOUT_INIT_REQUEST_MESSAGE);
|
|
|
+ timeout.set(() => top.postMessage(MESSAGE_PREFIX + "::" + JSON.stringify({ method: "initResponse", framesData: [{ windowId: frameWindowId, processed: true }], windowId: frameWindowId, sessionId }), "*"), TIMEOUT_INIT_REQUEST_MESSAGE);
|
|
|
});
|
|
|
top.postMessage(MESSAGE_PREFIX + "::" + JSON.stringify({ method: "initResponse", framesData, windowId, sessionId }), "*");
|
|
|
framesData = [];
|
|
|
frameElements.forEach((frameElement, frameIndex) => {
|
|
|
- const frameWinId = windowId + "." + frameIndex;
|
|
|
+ const frameWindowId = windowId + "." + frameIndex;
|
|
|
const frameWindow = frameElement.contentWindow;
|
|
|
const frameDoc = frameElement.contentDocument;
|
|
|
if (frameDoc) {
|
|
|
try {
|
|
|
- processFrames(frameDoc.querySelectorAll("iframe, frame, object[type=\"text/html\"][data]"), options, frameWinId, sessionId, frameWindow);
|
|
|
+ processFrames(frameDoc.querySelectorAll("iframe, frame, object[type=\"text/html\"][data]"), options, frameWindowId, sessionId, frameWindow);
|
|
|
const docData = docHelper.preProcessDoc(frameDoc, frameWindow, options);
|
|
|
- framesData.push({ windowId: frameWinId, content: docHelper.serialize(frameDoc), baseURI: frameDoc.baseURI, title: frameDoc.title, emptyStyleRulesText: docData.emptyStyleRulesText, canvasData: docData.canvasData, processed: true });
|
|
|
+ framesData.push({ windowId: frameWindowId, content: docHelper.serialize(frameDoc), baseURI: frameDoc.baseURI, title: frameDoc.title, emptyStyleRulesText: docData.emptyStyleRulesText, canvasData: docData.canvasData, processed: true });
|
|
|
docHelper.postProcessDoc(frameDoc, frameWindow, options);
|
|
|
} catch (error) {
|
|
|
/* ignored */
|