Created
May 7, 2021 18:24
-
-
Save josh-padnick/cf00be1d126a79090ad435af4cc09a34 to your computer and use it in GitHub Desktop.
Render images served from localhost in gmail
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
// Run this in your Chrome WebDev Tools console | |
// Based on https://stackoverflow.com/questions/20836911/images-not-displayed-for-gmail#comment114947075_20837071 | |
(function(){ while(img = document.evaluate('//img[contains(@src, \'googleusercontent.com\')][contains(@src, \'#\')]', document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue){ var src = img.attributes.src.value; src = src.substr(src.indexOf('#')+1); img.attributes.src.value = src; } })(); | |
// NOTE: I have NOT validated this gist as pasted above, though I have validated it manually (or some variant of it before) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment