Spaces:
Running
Running
Update index.html
Browse files- index.html +11 -3
index.html
CHANGED
@@ -20,7 +20,11 @@
|
|
20 |
|
21 |
<script>
|
22 |
function openWebsites() {
|
23 |
-
const urls = document.getElementById("urls").value
|
|
|
|
|
|
|
|
|
24 |
const limit = parseInt(document.getElementById("limit").value, 10);
|
25 |
|
26 |
if (isNaN(limit) || limit <= 0) {
|
@@ -29,9 +33,13 @@
|
|
29 |
}
|
30 |
|
31 |
const toOpen = urls.slice(0, limit);
|
32 |
-
|
|
|
|
|
33 |
const finalUrl = url.startsWith("http") ? url : "https://" + url;
|
34 |
-
|
|
|
|
|
35 |
});
|
36 |
}
|
37 |
</script>
|
|
|
20 |
|
21 |
<script>
|
22 |
function openWebsites() {
|
23 |
+
const urls = document.getElementById("urls").value
|
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) {
|
|
|
33 |
}
|
34 |
|
35 |
const toOpen = urls.slice(0, limit);
|
36 |
+
|
37 |
+
// Open each URL with a delay to reduce popup blocking
|
38 |
+
toOpen.forEach((url, index) => {
|
39 |
const finalUrl = url.startsWith("http") ? url : "https://" + url;
|
40 |
+
setTimeout(() => {
|
41 |
+
window.open(finalUrl, '_blank');
|
42 |
+
}, index * 500); // 500ms delay between each
|
43 |
});
|
44 |
}
|
45 |
</script>
|