Skip to content

Commit 9fa2ca3

Browse files
Update index.html
1 parent e81d050 commit 9fa2ca3

1 file changed

Lines changed: 33 additions & 10 deletions

File tree

webapps/auto_searcher/index.html

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<title>Search in New Tab</title>
5+
<title>Endless Search Tabs</title>
66
</head>
77
<body>
8-
<p>Opening search in a new tab…</p>
8+
<p>Opening Bing searches in new tabs every 5–8 seconds…</p>
9+
<p id="counter" style="color:gray;"></p>
10+
911
<script>
10-
if (!sessionStorage.getItem('opened')) {
11-
sessionStorage.setItem('opened', '1');
12+
// Prevent multiple loops if the page is reloaded
13+
if (sessionStorage.getItem('loopActive')) {
14+
document.body.innerHTML += '<p style="color:red">Loop already running in this session. Close this tab.</p>';
15+
} else {
16+
sessionStorage.setItem('loopActive', '1');
1217

1318
const keywords = [
1419
'javascript', 'python', 'algorithm', 'database', 'cloud',
@@ -18,13 +23,31 @@
1823
'network', 'cryptography', 'compiler', 'debugging', 'performance'
1924
];
2025

21-
const count = Math.floor(Math.random() * 3) + 3; // 3, 4, or 5
22-
const shuffled = keywords.sort(() => Math.random() - 0.5);
23-
const selected = shuffled.slice(0, count);
24-
const query = selected.join(' ');
26+
let tabCount = 0;
27+
const counterEl = document.getElementById('counter');
28+
29+
function openSearchTab() {
30+
// Pick 3–5 random keywords
31+
const count = Math.floor(Math.random() * 3) + 3; // 3, 4, or 5
32+
const shuffled = keywords.sort(() => Math.random() - 0.5);
33+
const selected = shuffled.slice(0, count);
34+
const query = selected.join(' ');
35+
const url = 'https://www.bing.com/search?q=' + encodeURIComponent(query);
36+
37+
// Open in new tab
38+
window.open(url, '_blank');
39+
40+
// Update counter
41+
tabCount++;
42+
counterEl.textContent = `Tabs opened: ${tabCount}`;
43+
44+
// Schedule next opening after 5–8 seconds
45+
const delay = Math.floor(Math.random() * 3001) + 5000; // 5000–8000 ms
46+
setTimeout(openSearchTab, delay);
47+
}
2548

26-
const url = 'https://www.bing.com/search?q=' + encodeURIComponent(query);
27-
window.open(url, '_blank');
49+
// Start the loop immediately (or after a short initial delay if preferred)
50+
openSearchTab();
2851
}
2952
</script>
3053
</body>

0 commit comments

Comments
 (0)