Proper JavaScript Window Management?
Let's say you have a script.
for example
Code:
// ==/UserScript==
clix();
function clix() {
//generate random number
x = getRandomInt(1, 20)
y = getRandomInt(1, 28);
clixdo(x, y);
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
Where clixdo is javascript for window.open( url + x + y )
How would you go about managing the windows, and properly closing them?
What about with a given time interval. (page needs to load another page and wait x time)
Given the code could be changed to new_window = window.open( some url ) and could be added to an array.