There is no way in javascript to do this. You must track them yourself:
var windowArray = []; // whenever you open a window... var newWindow = window.open(...); windowArray.push(newWindow); // whenever you close a window... if (opener && !opener.closed && opener.windowArray) { // search for your window in the array var matchingIndex = -1; for (var i = 0; i < opener.windowArray.length; i++) { if (opener.windowArray[i] === window) { matchingIndex = i; break; } } // if your window was found, remove it if (matchingIndex !== -1) { opener.windowArray.splice(matchingIndex, 1); } }
source share