-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs
More file actions
29 lines (28 loc) · 795 Bytes
/
js
File metadata and controls
29 lines (28 loc) · 795 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
// run auto-scroll first
setInterval(() => {
window.scrollTo(0, document.body.scrollHeight);
}, 2000);
// run unsave items...
const wait = ms => new Promise(r => setTimeout(r, ms));
async function removeSaved() {
while (true) {
const menuBtn = document.querySelector('[aria-label="More options for saved item"]');
if (!menuBtn) {
console.log("No saved items left");
break;
}
menuBtn.click();
await wait(700);
const unsaveBtn = [...document.querySelectorAll('[role="menuitem"]')]
.find(e => e.innerText.trim().toLowerCase().includes("unsave"));
if (unsaveBtn) {
unsaveBtn.click();
console.log("Unsaved one item");
} else {
console.log("Unsave option missing");
break;
}
await wait(1200);
}
}
removeSaved();