Skip to content

Instantly share code, notes, and snippets.

@josh-padnick
Created May 7, 2021 18:24
Show Gist options
  • Save josh-padnick/cf00be1d126a79090ad435af4cc09a34 to your computer and use it in GitHub Desktop.
Save josh-padnick/cf00be1d126a79090ad435af4cc09a34 to your computer and use it in GitHub Desktop.
Render images served from localhost in gmail
// 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