1 min readApr 9, 2019
If you don’t want to pollute the scope with variables, would be cool to have it like the following snippet?
var windows = [];window.open = (function($window) {
var win = $window.apply(this, arguments);
windows.push(win); return win;
})(window.open);
You can even extend it to the windows
array.