Skip to content

Instantly share code, notes, and snippets.

@Gerrit0
Created May 17, 2020 16:39
Show Gist options
  • Save Gerrit0/c0b6338bff4863084d5ee01256fcdaba to your computer and use it in GitHub Desktop.
Save Gerrit0/c0b6338bff4863084d5ee01256fcdaba to your computer and use it in GitHub Desktop.
// ==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