Created
November 7, 2021 11:15
-
-
Save virtueer/4aab76e76082b94f4db96e6e4c248e9e to your computer and use it in GitHub Desktop.
Instagram download image/video
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
// 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