Last active
September 5, 2025 22:47
-
-
Save glektarssza/a2b26b3e3798e9246f2e5254b026f7ae to your computer and use it in GitHub Desktop.
Remove Discord Voice Channel Activity Timer Experiment Tampermonkey Userscript
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 Remove Discord Voice Channel Activity Timer Experiment | |
| // @namespace http://glektarssza.com/ | |
| // @version 0.0.1 | |
| // @description Removes the experiment that adds timers to Discord voice channels indicating how long they've been active for. | |
| // @author G'lek Tarssza | |
| // @copyright 2025 G'lek Tarssza | |
| // @match https://discord.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=discord.com | |
| // @grant none | |
| // @sandbox DOM | |
| // @source https://gist.github.com/glektarssza/a2b26b3e3798e9246f2e5254b026f7ae | |
| // @updateURL https://gist.github.com/glektarssza/a2b26b3e3798e9246f2e5254b026f7ae/raw/discord-timer-anti-experiment.userscript.js | |
| // @downloadURL https://gist.github.com/glektarssza/a2b26b3e3798e9246f2e5254b026f7ae/raw/discord-timer-anti-experiment.userscript.js | |
| // @supportURL https://gist.github.com/glektarssza/a2b26b3e3798e9246f2e5254b026f7ae | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| const removeTimerElements = (node) => { | |
| const elems = Array.from(node.querySelectorAll?.('[class*="channelInfo_"] > [class*="tabularNumbers_"]') ?? []); | |
| console.log(`Found ${elems.length} elements to remove!`); | |
| elems.forEach((e) => e.remove()); | |
| }; | |
| const domChangeCallback = (mutationList) => { | |
| console.debug(`DOM mutated! Scanning for timers!`); | |
| for (const mutation of mutationList) { | |
| switch(mutation.type) { | |
| case 'childList': | |
| mutation.addedNodes.forEach((e) => removeTimerElements(e)); | |
| break; | |
| case 'attributes': | |
| //-- Do nothing | |
| break; | |
| case 'characterData': | |
| //-- Do nothing | |
| break; | |
| default: | |
| console.warn(`Unused DOM manipulation type "${mutation.type}"`); | |
| } | |
| } | |
| }; | |
| const sidebarObserver = new MutationObserver(domChangeCallback); | |
| const config = { childList: true, subtree: true }; | |
| const startupCallback = () => { | |
| const targetNode = document.querySelector('[class*="sidebar_"]'); | |
| if (!targetNode) { | |
| return; | |
| } | |
| mainObserver.disconnect(); | |
| sidebarObserver.observe(targetNode, config); | |
| }; | |
| const mainObserver = new MutationObserver(startupCallback); | |
| mainObserver.observe(document, config); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment