Skip to content

Instantly share code, notes, and snippets.

@zalesky
Created May 12, 2017 14:06
Show Gist options
  • Save zalesky/955ae9baa50c06cfbcc3605363121348 to your computer and use it in GitHub Desktop.
Save zalesky/955ae9baa50c06cfbcc3605363121348 to your computer and use it in GitHub Desktop.
saves images
let IMG_CLASS = '.slide_image';
let IMG_URL_ATTR = 'data-full';
let imgName = 0;
[...document.querySelectorAll(IMG_CLASS)].map(el => setTimeout(() => {
let link = document.createElement('a');
link.download = imgName++;
link.href = el.getAttribute(IMG_URL_ATTR) || el.getAttribute('src');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
delete link;
}, 500));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment