Created
February 28, 2016 02:08
-
-
Save cacheflowe/323a74aad892542fdd9d to your computer and use it in GitHub Desktop.
Download all .jpg attachments in an expanded gmail thread
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
var els = document.querySelectorAll('span[download_url]') | |
for(var i=0; i < els.length; i++){ | |
(function(){ | |
var attr = els[i].getAttribute('download_url'); | |
if(attr.indexOf('jpg:https') != -1){ | |
var url = 'https' + attr.split('jpg:https')[1]; | |
setTimeout(function(){ | |
document.location.href = url; | |
}, i * 1000) | |
} | |
})(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment