Created
February 6, 2017 05:20
-
-
Save Spaxe/03fddeda122d034566530030ba87a7bf to your computer and use it in GitHub Desktop.
Display all images from cache
This file contains hidden or 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
// From http://stackoverflow.com/questions/5876805/view-google-chromes-cached-pictures | |
var cached_anchors = $$('a'); | |
for (var i in cached_anchors) { | |
var ca = cached_anchors[i]; | |
if(ca.href.search('sprite') < 0 && ca.href.search('.png') > -1 || ca.href.search('.gif') > -1 || ca.href.search('.jpg') > -1) { | |
var a = document.createElement('a'); | |
a.href = ca.innerHTML; | |
a.target = '_blank'; | |
var img = document.createElement('img'); | |
img.src = ca.innerHTML; | |
img.style.maxHeight = '100px'; | |
a.appendChild(img); | |
document.getElementsByTagName('body')[0].appendChild(a); | |
} | |
} | |
document.getElementsByTagName('body')[0].removeChild(document.getElementsByTagName('table')[0]); | |
void(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment