Created
January 29, 2016 04:07
-
-
Save ckundo/4f31a97c86f439af7398 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Snowdenize All Images | |
// @namespace net.trmm.snowdenize | |
// @author Trammell Hudson <[email protected]> and Cameron Cundiff <[email protected]> | |
// @include * | |
// @Grant none | |
// @version 2 | |
// ==/UserScript== | |
(function() { | |
var snowden = 'https://media.giphy.com/media/l0NwuLOY7KkpCERSo/giphy.gif'; | |
var snowdenize = function() { | |
var gifs = document.querySelectorAll("img[src$='.gif']"); | |
Array.prototype.forEach.call(gifs, function(gif) { | |
gif.src = snowden; | |
}); | |
}; | |
snowdenize(); | |
var observer = new MutationObserver(function() { | |
snowdenize(); | |
}); | |
observer.observe(document.body, { childList: true }); | |
observer.disconnect; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment