-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisual memory.js
More file actions
32 lines (30 loc) · 817 Bytes
/
visual memory.js
File metadata and controls
32 lines (30 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//The version inspired by u/GainfulBirch228 is way better look elsewhere
let vMemory = [];
let vTimer;
let isClicking = 0
new MutationObserver(
(e) => {
if(isClicking == 1){return}
for (let index = 0; index < e.length; index++) {
if(e[index].target.classList.contains("active")){
vMemory.push(e[index].target);
}
}
clearTimeout(vTimer)
vTimer = setTimeout(()=> {
clicker()
}, 1500)
}
).observe(
document.getElementsByClassName("css-42wpoy")[0]
,{attributes: true, subtree:true}
)
function clicker(){
isClicking = 1;
while (vMemory.length > 0){
vMemory.shift().dispatchEvent(new Event("mousedown", {bubbles: true}));
}
setTimeout(() => {
isClicking = 0;
}, 10);
}