The window onload event was not triggering while a new tab being opened. The following is the sample code for doing the same. Here a list of URLs is being tried to open in separate same tab one after another, as the onload event is not being triggered, the recursive calls are not being happening.
var urls = ['https://stackoverflow.com/q/4907843', 'https://stackoverflow.com/q/19851782', 'https://stackoverflow.com/q/726761'];
function opennewtab(i) {
var w = window.open(urls[i], 'so', '');
if (w) {
w.onload = function() {
opennewtab(i + 1);
}
}
};
opennewtab(0);
All are in same domain. Please paste the code snippet in the browser developer tools in same page here.