I have a script that loops through multiple urls and opens them in a new tab. It used to work but now only opens the first one. There's even a w3schools test editor that supposedly opens multiple windows, and it also fails after the first one:
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open6
However, if I step through in debug mode and reset the focus to to original tab each time, it does open each window. So my question is, how do I open multiple windows(tabs) but keep the focus on my window with the original script? It used to do it that way, but now, as soon as a new tab is added, it gets the focus, and the script stops opening windows. Here's the full w3schools failing script:
<!DOCTYPE html>
<html>
<body>
<p>Click the button to open multiple windows.</p>
<button onclick="myFunction()">Open Windows</button>
<script>
function myFunction() {
window.open("http://www.google.com/");
window.open("https://www.w3schools.com/");
}
</script>
</body>
</html>