Last active
January 1, 2026 20:38
-
-
Save scmanjarrez/81e0d09575ddd5ebb1a5388a9fe1f4c6 to your computer and use it in GitHub Desktop.
Vibecoded mutation observer to hide annoyances in slash command and emoji pickers
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
| const discordUltimateHook = new MutationObserver(() => { | |
| // 1. ELIMINAR WORDLE (Panel Slash y Autocompletado) | |
| // Buscamos en el autocompletado filas que mencionen Wordle | |
| const autocompleteRows = document.querySelectorAll('[class*="autocompleteRow"]'); | |
| autocompleteRows.forEach(row => { | |
| if (row.textContent.toLowerCase().includes('wordle')) { | |
| if (row.style.display !== 'none') row.style.display = 'none'; | |
| } | |
| }); | |
| // Wordle en el panel principal de comandos | |
| const wordleButton = document.querySelector('[aria-label="Wordle"]'); | |
| if (wordleButton) { | |
| const container = wordleButton.closest('div[class*="-section"]') || wordleButton.closest('ul') || wordleButton.closest('[class*="autocompleteRow"]'); | |
| if (container && container.style.display !== 'none') container.style.display = 'none'; | |
| } | |
| // 2. EMOJI PICKER - LIMPIEZA DE SERVIDORES | |
| // Izquierda (Iconos circulares) | |
| document.querySelectorAll('[class*="categoryItemGuildCategory"]').forEach(icon => { | |
| const wrapper = icon.closest('div[aria-describedby]'); | |
| if (wrapper && wrapper.style.display !== 'none') { | |
| wrapper.style.display = 'none'; | |
| if (wrapper.nextElementSibling?.tagName === 'SPAN') wrapper.nextElementSibling.style.display = 'none'; | |
| } | |
| }); | |
| // Derecha (Secciones completas) | |
| document.querySelectorAll('[class*="categorySection"]').forEach(section => { | |
| const isServer = section.querySelector('img[class*="guildIcon"]') || section.querySelector('[aria-label="Wordle"]'); | |
| if (isServer && section.style.display !== 'none') section.style.display = 'none'; | |
| }); | |
| const hr = document.querySelector('hr[class*="guildCategorySeparator"]'); | |
| if (hr && hr.style.display !== 'none') hr.style.display = 'none'; | |
| // 3. SALTOS DE SCROLL (Evitar espacio vacío) | |
| const handleJump = (selector, key) => { | |
| const el = document.querySelector(selector); | |
| if (el) { | |
| if (!el.dataset[key]) { | |
| el.scrollTop = el.scrollHeight; | |
| el.dataset[key] = "true"; | |
| setTimeout(() => { el.scrollTop = el.scrollHeight; }, 150); | |
| } | |
| } else { | |
| document.querySelectorAll(`[data-${key}]`).forEach(d => d.dataset[key] = ""); | |
| } | |
| }; | |
| handleJump('div[class*="categoryList"] [class*="scrollerBase"]', 'jumpL'); | |
| handleJump('div[class*="listWrapper"] [class*="scrollerBase"]', 'jumpR'); | |
| }); | |
| discordUltimateHook.observe(document.body, { childList: true, subtree: true }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment