Last active 1693403813

Revision 2f3fd773056ae869ba6b5751a17f903b59ee9057

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 `finds = ["cat", "gopher", ...]`;
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
16// When a keywords from finds is found, a confirmation appears
17// Esc/cancel to keep going
18// Enter/OK to stay on this roll to choose the found item
19async function nextFind() {
20 let cat = null;
21 while (true) {
22 cat = checkNames();
23 if (cat !== null) {
24 if (confirm(cat)) break;
25 }
26 optBtn.click();
27 await new Promise(r => setTimeout(r, 1000));
28 }
29}
30
31// await nextFind()