Skip to content

Instantly share code, notes, and snippets.

@tdewin
Created December 17, 2025 10:46
Show Gist options
  • Select an option

  • Save tdewin/34d5d522d4218192ffc67423e3b96f41 to your computer and use it in GitHub Desktop.

Select an option

Save tdewin/34d5d522d4218192ffc67423e3b96f41 to your computer and use it in GitHub Desktop.
download-all-images-in-browser-console.js
//download all images with class name icon or whatever you select
//requires emulate user gesture checkbox in safari to run
//set timeout seems to be required to get safari to download all individual icons
let icons = document.getElementsByClassName("icon")
for (let i=0;i<icons.length;i++) {
setTimeout(() => {
let alocal = document.createElement("a")
alocal.setAttribute("download","")
alocal.setAttribute("href",icons[i].getAttribute("src"))
alocal.click();
console.log(icons[i].getAttribute("src"))
},i*100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment