Skip to content

Instantly share code, notes, and snippets.

@drwpow
Created August 27, 2017 16:07
Show Gist options
  • Save drwpow/f6e7c24764ee228b622cbbbc0a0898d8 to your computer and use it in GitHub Desktop.
Save drwpow/f6e7c24764ee228b622cbbbc0a0898d8 to your computer and use it in GitHub Desktop.
Browse Google Chrome Image Cache
/**
* Browse Google Chome Image Cache
* Navigate to chrome://cache/, then paste this into Console tab to browse images as a long feed
*/
// 1. Filter out domains (optional; uncomment to enable)
// This shows how to only allow images from `twimg.com`
//
// var nonLinks = document.querySelectorAll('a')
// nonLinks.forEach(link => link.innerText.indexOf('twimg.com') !== -1 ? undefined : link.remove());
// 2. Look through all the images left, replacing innerText with <img> tags
var i = 0;
var links = document.querySelectorAll('a');
setInterval(() => {
if (links[i]) {
links[i].innerHTML = `<img src="${links[i].innerText}">`; // important to grab innerText, not the Chrome Cache link
i++;
}
}, 500); // happens every 500ms (2x per minute). If this fires too fast, Chrome will crash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment