Spaces:
Running
Running
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Open Same Website Multiple Times</title> | |
<style> | |
body { font-family: sans-serif; padding: 20px; } | |
textarea, input { width: 100%; margin-top: 10px; } | |
textarea { height: 60px; } | |
button { padding: 10px 20px; margin-top: 10px; font-size: 16px; } | |
</style> | |
</head> | |
<body> | |
<h2>Open Website Multiple Times</h2> | |
<p>Enter a single URL (include https://):</p> | |
<textarea id="urls" placeholder="https://example.com"></textarea> | |
<p>Number of tabs to open:</p> | |
<input type="number" id="limit" placeholder="e.g. 5" min="1"><br> | |
<button onclick="openWebsiteMultipleTimes()">Open Website</button> | |
<script> | |
function openWebsiteMultipleTimes() { | |
const urlInput = document.getElementById("urls").value.trim(); | |
const limit = parseInt(document.getElementById("limit").value, 10); | |
if (!urlInput) { | |
alert("Please enter a URL."); | |
return; | |
} | |
if (isNaN(limit) || limit <= 0) { | |
alert("Please enter a valid number greater than 0."); | |
return; | |
} | |
const finalUrl = urlInput.startsWith("http") ? urlInput : "https://" + urlInput; | |
for (let i = 0; i < limit; i++) { | |
setTimeout(() => { | |
window.open(finalUrl, '_blank'); | |
}, i * 300); // delay each open slightly | |
} | |
} | |
</script> | |
</body> | |
</html> | |