Skip to content

Instantly share code, notes, and snippets.

@kristianrl
Created January 14, 2021 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristianrl/8639279c1e7939e0a391764cb160d721 to your computer and use it in GitHub Desktop.
Save kristianrl/8639279c1e7939e0a391764cb160d721 to your computer and use it in GitHub Desktop.
Paste the URLs you want to open in new tabs in the list below, with one URL per line. Note that this is not working on Google Chrome, but works in Internet Explorer.
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>New browser tab for each line</title>
<script>
function searchgoogle () {
var searchlines = document.getElementById("searchfield").value;
searchlines = searchlines.split("\n");
for (var i = 0; i < searchlines.length; i++) {
window.open(searchlines[i], i);
}
}
</script>
</head>
<body>
Paste the URLs you want to open in new tabs in the list below, with one URL per line.<br />
<textarea id="searchfield" style="height: 400px; width: 100%;"></textarea><br />
<button onclick="searchgoogle()">Open tabs</button>
<div style="background-color: pink;" id="output"></div>
Note that this is <a href="http://stackoverflow.com/questions/16749907/window-open-behaviour-in-chrome-tabs-windows">not working on Google Chrome</a>, but works in Internet Explorer.
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment