|
|
@@ -21,7 +21,7 @@
|
|
|
* Source.
|
|
|
*/
|
|
|
|
|
|
-/* global window */
|
|
|
+/* global window, setTimeout, clearTimeout */
|
|
|
|
|
|
this.singlefile.lib.processors.frameTree.content.frames = this.singlefile.lib.processors.frameTree.content.frames || (() => {
|
|
|
|
|
|
@@ -46,8 +46,6 @@ this.singlefile.lib.processors.frameTree.content.frames = this.singlefile.lib.pr
|
|
|
const top = window.top;
|
|
|
const MessageChannel = window.MessageChannel;
|
|
|
const document = window.document;
|
|
|
- const setTimeout = window.setTimeout;
|
|
|
- const clearTimeout = window.clearTimeout;
|
|
|
|
|
|
const sessions = new Map();
|
|
|
let windowId;
|
|
|
@@ -235,7 +233,7 @@ this.singlefile.lib.processors.frameTree.content.frames = this.singlefile.lib.pr
|
|
|
} catch (error) {
|
|
|
// ignored
|
|
|
}
|
|
|
- requestTimeouts[windowId] = setTimeout.call(window, () => sendInitResponse({ frames: [{ windowId, processed: true }], sessionId }), TIMEOUT_INIT_REQUEST_MESSAGE);
|
|
|
+ requestTimeouts[windowId] = setTimeout(() => sendInitResponse({ frames: [{ windowId, processed: true }], sessionId }), TIMEOUT_INIT_REQUEST_MESSAGE);
|
|
|
});
|
|
|
delete doc.documentElement.dataset.requestedFrameId;
|
|
|
}
|
|
|
@@ -271,7 +269,7 @@ this.singlefile.lib.processors.frameTree.content.frames = this.singlefile.lib.pr
|
|
|
if (session && session[type]) {
|
|
|
const timeout = session[type][windowId];
|
|
|
if (timeout) {
|
|
|
- clearTimeout.call(window, timeout);
|
|
|
+ clearTimeout(timeout);
|
|
|
delete session[type][windowId];
|
|
|
}
|
|
|
}
|
|
|
@@ -280,7 +278,7 @@ this.singlefile.lib.processors.frameTree.content.frames = this.singlefile.lib.pr
|
|
|
function createFrameResponseTimeout(sessionId, windowId) {
|
|
|
const session = sessions.get(sessionId);
|
|
|
if (session && session.responseTimeouts) {
|
|
|
- session.responseTimeouts[windowId] = setTimeout.call(window, () => sendInitResponse({ frames: [{ windowId: windowId, processed: true }], sessionId: sessionId }), TIMEOUT_INIT_RESPONSE_MESSAGE);
|
|
|
+ session.responseTimeouts[windowId] = setTimeout(() => sendInitResponse({ frames: [{ windowId: windowId, processed: true }], sessionId: sessionId }), TIMEOUT_INIT_RESPONSE_MESSAGE);
|
|
|
}
|
|
|
}
|
|
|
|