Skip to content

Instantly share code, notes, and snippets.

@robwent
Created February 18, 2017 01:16
Show Gist options
  • Save robwent/d1736f8d7366cb25f1d0dd5fb2ba57bc to your computer and use it in GitHub Desktop.
Save robwent/d1736f8d7366cb25f1d0dd5fb2ba57bc to your computer and use it in GitHub Desktop.
Open a list of links in new browser tabs
<!doctype html>
<html>
<head>
<title>Open Tas</title>
<script>
function openWindow(){
var x = document.getElementById('a').value.split('\n');
for (var i = 0; i < x.length; i++)
if (x[i].indexOf('.') > 0)
if (x[i].indexOf('://') < 0)
window.open('http://'+x[i]);
else
window.open(x[i]);
}
</script>
<style>
html, body
{
height : 99%;
width : 99%;
}
textarea
{
height : 80%;
width : 90%;
}
</style>
</head>
<body>
<textarea id="a"></textarea>
<br>
<input type="button" value="Open Windows" onClick="openWindow()">
<input type="button" value="Clear" onClick="document.getElementById('a').value=''">
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment