Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Created December 17, 2022 00:29
Show Gist options
  • Save ddrscott/47a000e3723029a8aa2917895a7bfbef to your computer and use it in GitHub Desktop.
Save ddrscott/47a000e3723029a8aa2917895a7bfbef to your computer and use it in GitHub Desktop.
(
(imgs, h) => imgs.forEach((i, idx) => {
let l = document.createElement('a');
l.href=i.src;
l.download=`image-${idx}.png`;
l.innerText=l.download;
h.appendChild(l)
})
)(
d.querySelectorAll("#jmuse-scroller-component img[alt]"),
document.querySelector('nav[state=primary]')
)
@ddrscott
Copy link
Author

Use MrColes to build a bookmarklet

It'll looks something like this:

javascript:(function()%7B((d%2C%20h)%20%3D%3E%20d.querySelectorAll(%22%23jmuse-scroller-component%20img%5Balt%5D%22).forEach((i%2C%20idx)%20%3D%3E%20%7B%20let%20l%20%3D%20d.createElement('a')%3B%20l.href%3Di.src%3B%20l.download%3D%60image-%24%7Bidx%7D.png%60%3B%20l.innerText%3Dl.download%3B%20%20h.appendChild(l)%20%7D))(document%2C%20document.querySelector('nav%5Bstate%3Dprimary%5D'))%7D)()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment