Skip to content
Snippets Groups Projects
Commit d8e1f47c authored by Tom Robinson's avatar Tom Robinson
Browse files

Try wrapping setTimeout to check for closed window

parent 8ddeaec8
No related branches found
No related tags found
No related merge requests found
console.log("INIT!", new Error().stack);
const _close = window.close;
window.close = function() {
console.log("CLOSE!", new Error().stack);
return _close.apply(this, arguments);
};
const _setTimeout = window.setTimeout;
window.setTimeout = function(fn, ...args) {
if (typeof fn === "function") {
const stack = new Error().stack;
const _fn = fn;
fn = function() {
if (!window.document) {
console.log("WINDOW CLOSED, SKIPPING TIMEOUT", stack);
// return;
}
return _fn.apply(this, arguments);
};
}
return _setTimeout.call(this, fn, ...args);
};
/* global process, jasmine */
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment