Skip to content

Instantly share code, notes, and snippets.

@virtueer
Created November 7, 2021 11:15
Show Gist options
  • Save virtueer/4aab76e76082b94f4db96e6e4c248e9e to your computer and use it in GitHub Desktop.
Save virtueer/4aab76e76082b94f4db96e6e4c248e9e to your computer and use it in GitHub Desktop.
Instagram download image/video
// ctrl + click to video: downloads
// ctrl + click image: opens image in new tab. So the image can be right clicked and downloaded.
// Tested only feed
document.body.onclick = function (event){
if (window.event.ctrlKey) {
if(event.target.ariaLabel !== null)
window.open(event.target.previousElementSibling.previousElementSibling.children[0].children[0].children[0].currentSrc)
else
window.open(event.target.previousElementSibling.children[0].currentSrc)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment