Last active 1693403813

Revision d16812c5e0ca00d37e2ee8da20d854d6ece8bfbc

tailnet.js Raw
1// Set finds to a list of keywords
2// finds = ["cat", "gopher"]
3let finds = null;
4
5function checkNames() {
6 if (finds === null) return "honk!";
7 const names = document.querySelectorAll('[name="tcd-rad"]');
8 for (let name of names) {
9 for (let find of finds){
10 if (name.value.endsWith(`-${find}.ts.net`) || name.value.startsWith(`${find}-`)) return name.value;
11 }
12 }
13 return null;
14}
15
16async function nextCat() {
17 let cat = null;
18 while (true) {
19 cat = checkNames();
20 if (cat !== null) {
21 if (confirm(cat)) break;
22 }
23 optBtn.click();
24 await new Promise(r => setTimeout(r, 1000));
25 }
26}