Last active
September 19, 2015 23:36
-
-
Save elboletaire/792211fb4376d705f44b to your computer and use it in GitHub Desktop.
Removes the gmail caching prefix for images, leaving just the real images.
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 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