Created
May 17, 2020 16:39
-
-
Save Gerrit0/c0b6338bff4863084d5ee01256fcdaba 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 Block GIF avatars | |
// @namespace https://gerritbirkeland.com/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://discord.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
new MutationObserver((list) => { | |
for (const item of list.filter(item => item.type === 'attributes' && item.attributeName === 'src')) { | |
if (/avatars\/.*\.gif/.test(item.target.src)) { | |
item.target.src = item.target.src.replace(".gif", ".png") | |
} | |
} | |
}).observe(document.body, { attributes: true, subtree: true }) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment