Created
May 2, 2021 11:42
-
-
Save apie/4510980347ca9aec84d35fb2d86ebae3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function download(url) { | |
let element = document.createElement('a'); | |
element.setAttribute('href', url); | |
element.setAttribute('download', url.split('/')[url.split('/').length-1]); | |
element.style.display = 'none'; | |
document.body.appendChild(element); | |
element.click(); | |
document.body.removeChild(element); | |
}; | |
Array.from(document.getElementsByClassName('gallery-slide-small-image')).forEach((d) => { | |
const url = d.style.getPropertyValue('background-image').split('"')[1]; | |
download(url); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment