Files
tool__scripts/browser-snippets/img-auto-clicker.js
2026-07-09 01:05:56 +02:00

32 lines
687 B
JavaScript

const delay = 300; // ms between clicks
const thumbs = Array.from(document.querySelectorAll("img"));
let i = 0;
console.log("💠‍🌐 Found " + thumbs.length + " images. Initiating click rampage.");
const clicker = setInterval(() => {
if (i >= thumbs.length) {
clearInterval(clicker);
console.log("🙄 Finished clicking everything.");
return;
}
const img = thumbs[i];
try {
img.scrollIntoView({ block: "center" });
img.dispatchEvent(new MouseEvent("click", {
bubbles: true,
cancelable: true,
view: window
}));
console.log("💠‍🌐 Clicked #" + i + " -> " + (img.src || "no-src"));
} catch (e) {}
i++;
}, delay);