Remove the reddit avatars in the comments and post list for easier reading.
// ==UserScript==
// @name Reddit remove avatars
// @name:de Entferne Reddit Profilbilder
// @version 1.1.1
// @description Remove the reddit avatars in the comments and post list for easier reading.
// @description:de Entfernt alle Profilbilder aus den Kommentaren und Beiträgen auf Reddit.
// @author Drados
// @match https://www.reddit.com/r/*
// @license GPL-3.0 license
// @run-at document-idle
// @namespace https://greasyfork.org/users/1559751
// ==/UserScript==
// this removes the stupid background bloom on posts, needs // @grant GM_addStyle
//GM_addStyle ( `
//.opacity-30 {
// opacity: 0 !important;
//}
//` );
function removePostListAvatars() {
let e = document.getElementsByClassName("inline-flex items-center justify-center w-lg h-lg relative ");
if (e) {
for (let i = 0; i < e.length; i++) {
e[i].remove();
}
}
}
function removeCommentAvatarDivs() {
const divs = document.querySelectorAll('div[slot="commentAvatar"]');
divs.forEach(div => div.remove());
}
function updateUsernameMargin() {
const elements = document.querySelectorAll('.author-name-meta');
let parent_node;
elements.forEach(element => {
// move usernames to the left, changing this to -2 will look better but the collapsed comment button will overlap
element.style.marginLeft = '-1.5rem';
parent_node = element.parentNode;
parent_node.style.overflow = "visible";
parent_node = parent_node.parentNode;
parent_node.style.overflow = "visible";
parent_node = parent_node.parentNode;
parent_node.style.overflow = "visible";
parent_node.parentNode.style.overflow = "visible";
});
}
const observer = new MutationObserver((mutationsList) => {
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
updateUsernameMargin();
removeCommentAvatarDivs();
removePostListAvatars();
}
}
});
observer.observe(document.body, { childList: true, subtree: true });