|
|
@@ -83,8 +83,7 @@ this.frameTree = this.frameTree || (() => {
|
|
|
},
|
|
|
cleanup: options => {
|
|
|
const sessionId = options.sessionId || 0;
|
|
|
- options = JSON.parse(JSON.stringify(options));
|
|
|
- cleanupRequest({ windowId, sessionId, options });
|
|
|
+ cleanupRequest({ windowId, sessionId, options: { sessionId } });
|
|
|
},
|
|
|
initResponse,
|
|
|
TIMEOUT_INIT_REQUEST_MESSAGE
|
|
|
@@ -105,7 +104,7 @@ this.frameTree = this.frameTree || (() => {
|
|
|
function cleanupRequest(message) {
|
|
|
const sessionId = message.sessionId;
|
|
|
const frameElements = document.querySelectorAll(FRAMES_CSS_SELECTOR);
|
|
|
- cleanupFrames(frameElements, message.options, message.windowId, sessionId);
|
|
|
+ cleanupFrames(frameElements, message.windowId, sessionId);
|
|
|
}
|
|
|
|
|
|
function initResponse(message) {
|
|
|
@@ -199,12 +198,12 @@ this.frameTree = this.frameTree || (() => {
|
|
|
delete doc.documentElement.dataset.requestedFrameId;
|
|
|
}
|
|
|
|
|
|
- function cleanupFrames(frameElements, options, parentWindowId, sessionId) {
|
|
|
+ function cleanupFrames(frameElements, parentWindowId, sessionId) {
|
|
|
frameElements.forEach((frameElement, frameIndex) => {
|
|
|
const windowId = parentWindowId + WINDOW_ID_SEPARATOR + frameIndex;
|
|
|
frameElement.removeAttribute(docHelper.WIN_ID_ATTRIBUTE_NAME);
|
|
|
try {
|
|
|
- sendMessage(frameElement.contentWindow, { method: CLEANUP_REQUEST_MESSAGE, windowId, sessionId, options });
|
|
|
+ sendMessage(frameElement.contentWindow, { method: CLEANUP_REQUEST_MESSAGE, windowId, sessionId });
|
|
|
} catch (error) {
|
|
|
/* ignored */
|
|
|
}
|
|
|
@@ -219,7 +218,7 @@ this.frameTree = this.frameTree || (() => {
|
|
|
}
|
|
|
if (frameDoc) {
|
|
|
try {
|
|
|
- cleanupFrames(frameDoc.querySelectorAll(FRAMES_CSS_SELECTOR), options, windowId, sessionId);
|
|
|
+ cleanupFrames(frameDoc.querySelectorAll(FRAMES_CSS_SELECTOR), windowId, sessionId);
|
|
|
} catch (error) {
|
|
|
// ignored
|
|
|
}
|