Last active
June 20, 2019 16:33
-
-
Save AndresInSpace/984bb5e065bb7810a39edc3260ce020f to your computer and use it in GitHub Desktop.
For Designers: Scrap IG Image using Bookmarklet JS+Alerts/Prompts
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
//add this as the URL of your bookmark, then just click the bookmark to trigger the script when you are on an IG page with an image selected. | |
javascript:(function(){var dialog = document.querySelector('.vCf6V'); var standAlone = document.querySelector('._97aPb'); if(!dialog && standAlone){ dialog = standAlone; } if(!dialog && !standAlone){ alert('Please open a IG image to scrape it.'); } else { dialog.querySelectorAll('.FFVAD').forEach(function(e){ var list = e.srcset.split(',').reverse(); list.forEach(function(source){ var sizeimg = source.split(' '); prompt('The image size is:'+sizeimg[1],sizeimg[0]) }) }) }})(); | |
//alternative; opens largest image in new tab automatically | |
javascript:(function(){var dialog = document.querySelector('.vCf6V'); var standAlone = document.querySelector('._97aPb'); if(!dialog && standAlone){ dialog = standAlone; } if(!dialog && !standAlone){ alert('Please open a IG image to scrape it.'); } else { dialog.querySelectorAll('.FFVAD').forEach(function(e){ var list = e.srcset.split(',').reverse(); var sizeimg = list[0].split(' '); var source = sizeimg[0].split('?'); var newWindow = window.open(sizeimg[0]); }) }})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment