Skip to content

Instantly share code, notes, and snippets.

@elboletaire
Last active September 19, 2015 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elboletaire/792211fb4376d705f44b to your computer and use it in GitHub Desktop.
Save elboletaire/792211fb4376d705f44b to your computer and use it in GitHub Desktop.
Removes the gmail caching prefix for images, leaving just the real images.
var images = document.getElementsByTagName('img');
for (var i in images) {
if (typeof images[i] !== 'object' || typeof images[i].src === 'undefined') continue;
if (/([^#]+)#(https?.+)/.test(images[i].src)) {
var matches = images[i].src.match(/([^#]+)#(https?.+)/);
images[i].src = matches[2];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment