Skip to content

Instantly share code, notes, and snippets.

@charusat09
Created August 24, 2017 06:07
Show Gist options
  • Save charusat09/1ff41afdbde72f00fd9f9d7477ced73b to your computer and use it in GitHub Desktop.
Save charusat09/1ff41afdbde72f00fd9f9d7477ced73b to your computer and use it in GitHub Desktop.
var delay = 5 * 1000; // will sleep for 5 seconds
// add sites in this array with comma seperated
var values = [
"https://www.google.com",
"https://linkedin.com"
];
for (var i = 0; i < values.length; i++) {
sleep(delay);
openPage(values[i]);
}
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds) {
break;
}
}
}
function openPage(link) {
window.open(link, '_blank');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment