Created
May 14, 2014 21:37
-
-
Save jmikkola/cbf2bdda31fb52bde193 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Fix gmail images | |
// @namespace fixGmailImages | |
// @match https://mail.google.com/* | |
// ==/UserScript== | |
// | |
(function() { | |
function fix() { | |
var images = document.getElementsByTagName('img'); | |
for (var i = 0; i < images.length; i++) { | |
var src = images[i].src; | |
if (/.*googleusercontent.*#.*/.exec(src)) { | |
images[i].src = src.split(/#/)[1]; | |
} | |
} | |
} | |
var G_KEY_CODE = 71; | |
document.addEventListener('keydown', function(e) { | |
if (e.keyCode == G_KEY_CODE && e.shiftKey && e.altKey && !e.ctrlKey && !e.metaKey) { | |
console.log('fixing images'); | |
fix(); | |
} | |
}, false); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment