Spaces:
Running
Running
Update index.html
Browse files- index.html +17 -18
index.html
CHANGED
@@ -2,45 +2,44 @@
|
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
-
<title>
|
6 |
<style>
|
7 |
body { font-family: sans-serif; padding: 20px; }
|
8 |
textarea, input { width: 100%; margin-top: 10px; }
|
9 |
-
textarea { height:
|
10 |
button { padding: 10px 20px; margin-top: 10px; font-size: 16px; }
|
11 |
</style>
|
12 |
</head>
|
13 |
<body>
|
14 |
-
<h2>
|
15 |
-
<p>Enter
|
16 |
<textarea id="urls" placeholder="https://example.com"></textarea>
|
17 |
-
<p>Number of
|
18 |
<input type="number" id="limit" placeholder="e.g. 5" min="1"><br>
|
19 |
-
<button onclick="
|
20 |
|
21 |
<script>
|
22 |
-
function
|
23 |
-
const
|
24 |
-
.split('\n')
|
25 |
-
.map(url => url.trim())
|
26 |
-
.filter(Boolean);
|
27 |
-
|
28 |
const limit = parseInt(document.getElementById("limit").value, 10);
|
29 |
|
|
|
|
|
|
|
|
|
|
|
30 |
if (isNaN(limit) || limit <= 0) {
|
31 |
alert("Please enter a valid number greater than 0.");
|
32 |
return;
|
33 |
}
|
34 |
|
35 |
-
const
|
36 |
|
37 |
-
|
38 |
-
toOpen.forEach((url, index) => {
|
39 |
-
const finalUrl = url.startsWith("http") ? url : "https://" + url;
|
40 |
setTimeout(() => {
|
41 |
window.open(finalUrl, '_blank');
|
42 |
-
},
|
43 |
-
}
|
44 |
}
|
45 |
</script>
|
46 |
</body>
|
|
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
+
<title>Open Same Website Multiple Times</title>
|
6 |
<style>
|
7 |
body { font-family: sans-serif; padding: 20px; }
|
8 |
textarea, input { width: 100%; margin-top: 10px; }
|
9 |
+
textarea { height: 60px; }
|
10 |
button { padding: 10px 20px; margin-top: 10px; font-size: 16px; }
|
11 |
</style>
|
12 |
</head>
|
13 |
<body>
|
14 |
+
<h2>Open Website Multiple Times</h2>
|
15 |
+
<p>Enter a single URL (include https://):</p>
|
16 |
<textarea id="urls" placeholder="https://example.com"></textarea>
|
17 |
+
<p>Number of tabs to open:</p>
|
18 |
<input type="number" id="limit" placeholder="e.g. 5" min="1"><br>
|
19 |
+
<button onclick="openWebsiteMultipleTimes()">Open Website</button>
|
20 |
|
21 |
<script>
|
22 |
+
function openWebsiteMultipleTimes() {
|
23 |
+
const urlInput = document.getElementById("urls").value.trim();
|
|
|
|
|
|
|
|
|
24 |
const limit = parseInt(document.getElementById("limit").value, 10);
|
25 |
|
26 |
+
if (!urlInput) {
|
27 |
+
alert("Please enter a URL.");
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
|
31 |
if (isNaN(limit) || limit <= 0) {
|
32 |
alert("Please enter a valid number greater than 0.");
|
33 |
return;
|
34 |
}
|
35 |
|
36 |
+
const finalUrl = urlInput.startsWith("http") ? urlInput : "https://" + urlInput;
|
37 |
|
38 |
+
for (let i = 0; i < limit; i++) {
|
|
|
|
|
39 |
setTimeout(() => {
|
40 |
window.open(finalUrl, '_blank');
|
41 |
+
}, i * 300); // delay each open slightly
|
42 |
+
}
|
43 |
}
|
44 |
</script>
|
45 |
</body>
|