A few days ago, I created a userscript to never see 'reply from someone you muted' again.
Due to the popular demand here of three other stackers, I decided it's worth making it easier to install and writing a post about it.
I still have to figure out if there's a way to run this in the PWA, too.
mutenukemutenuke
Never see 'reply from someone you muted' on Stacker News again.
Installation via userscript extensionInstallation via userscript extension
- Install a userscript extension like Tampermonkey
- Go to the mutenuke page on GreasyFork
- Click "Install this script"
Installation via Brave ShieldsInstallation via Brave Shields
On Brave, you don't need a userscript extension. You can run custom scriptlets within Shields as mentioned here!
- Go to brave://settings/shields/filters
- Enable developer mode
- Save this as a new custom scriptlet named 'mutenuke':
window.addEventListener('DOMContentLoaded', () => {
function mutenuke() {
document.querySelectorAll('div[class*="comment_collapsed"]')
.forEach(node => {
if (node.textContent.startsWith("reply from someone you muted")) node.remove()
}
)
}
// Run on initial page load
mutenuke();
// Watch for dynamically loaded content
const observer = new MutationObserver(mutenuke);
observer.observe(document.body, { childList: true, subtree: true });
})- Save this as a new custom filter:
stacker.news##+js(user-mutenuke.js)Done!
Installation via Brave Shields will cause React hydration errors, but as far as I know, it doesn't impact the functionality of the site.
Fixes courtesy of:
runAfterHydration: GPT, Claude, Gemini and GLM (all said the same, lol)node.style = "visibility: hidden"instead ofnode.remove(): Opti, because the removal gave me errors on comment.window.addEventListener('load', () => { function runAfterHydration(callback) { requestAnimationFrame(() => { requestAnimationFrame(callback); }); } runAfterHydration(() => { function removeCollapsedComments() { document .querySelectorAll('div[class*="comment_collapsed"]') .forEach(node => { if (node.textContent.startsWith("reply from someone you muted")) { node.style = "visibility: hidden"; } }); } removeCollapsedComments(); const observer = new MutationObserver(removeCollapsedComments); observer.observe(document.body, { childList: true, subtree: true }); }); });Ohh, nice fix! Also nice edit within the 10-minute timer, haha
It was the ultimate pressure cooking exercise in javascript debugging because I wrote "verified works" and then I hit
postand it died 😂Mhh,
node.style = "visibility: hidden"leaves empty space behind.But
node.style = "display: none"should work! The node is still there for React without taking up any space in the DOM.confirmed. This why you don't let old people code for the browser 😂
With
node.style = "display: none", you can also keep running it after the slightly fasterDOMContentLoadedevent and don't needrequestAnimationFrame. Theloadevent will also wait until images are loaded.Thank you!!
Wait! Are you saying that my noob code reimplemented by you, and not the trillion dollar training of the 4 most expensive databases that have ever existed, fixed the bug?
Take that, silicon brains. lol
You probably told it to run after hydration, and that’s what it did, haha
But when we don’t remove the node, we don’t interfere with hydration, so we don’t need to run it after hydration.
Edit: But sounded like it was still broken after the first prompt, so you prompted it again, and that contained the actual, inspiring fix via CSS haha
Op @ek why don't you attach and show attached LN wallets?
Clearly you are capable but maybe you dont believe in verifying you are on board with and maximising your use of and support of LN here on SNs?
Genuinely mystified why you would not attach or deliberately conceal your LN wallet attached status.
I don't need to virtue-signal about lightning, my work speaks for itself
You do not believe content consumers here who ultimately must fund the entire platform if it is to be viable have a right to know which content providers have made the effort to attach LN wallets and thereby maximise their use of and support for the LN?
There are a number content providers who write a lot about LN development and potential who 'virtue signalling' that they are 'living on the Bitcoin Standard' but who have never bothered to attach both sending and receiving LN wallets. I see that as hypocrisy and do not want to spend my sats on them.
Showing attached wallets verifies to content consumers that a content provider is NOT just virtue signalling but is walking the talk.
After ten hours @ek has not answered this simple question that addresses the core values and nature of SNs and its V4V P2P nominally sats denominated ethos.
Maybe @ek has given up on the dream to build a V4V social media platform using sats as much as possible?
So I ask again-
You do not believe content consumers here who ultimately must fund the entire platform if it is to be viable have a right to know which content providers have made the effort to attach LN wallets and thereby maximise their use of and support for the LN?
Silence???
Have you considered that many stackers don't bother responding to you because of how you are acting?
The only ones not responding are the ones I ask questions that make them uncomfortable to answer.
Either they do not answer or respond with childish trolling that seeks to evade the question asked and divert attention to shooting me, the messenger.
I have always sought a reasoned dialogue as the first option and only resort to downzapping as a last resort.
Nobody has credibly argued how a content provider here who identifies as a Bitcoiner and frequently posts about Bitcoin cannot be a hypocrit where they do not attach LN wallets and show that they have so that content consumer can see the content provider is consistent and true to their stated beliefs.
Content consumers (like me) have every right to want content providers to demonstrate consistency between their words and actions.
Hypocrisy is not a good look and does not deserve V4V zaps.
I believe content consumers here (like me) who ultimately must fund the entire platform if it is to be viable have a right to know which content providers (especially those proclaiming to be Bitcoin advocates and enthusiasts) have made the effort to attach LN wallets and thereby maximise their use of and support for the LN.
Do you disagree?
I genuinely cannot understand why a Bitcoiner would not attach wallets and maximise the degree to which they use sats and support the LNs growth and liquidity instead of inferior CC shitcoins- unless they are a total hypocrit and maybe don't even realise it?
Does your script hide the comments from muted users that stay collapsed until you click on them? It could be a toggle in the SN settings, and the name is really good.
It removes the entire thread underneath your mute too, so you won't be bothered by it.
The only flaw is that if you're subscribed to a post, then you will see replies from others to it in your notifications, but not under the post itself.
this is enough for me but completely understandable when you hae a lot of muted nym to pollute a good post.
Where in SN settings @k00b?
the problem with making this a feature, as is, is that the comment counts won't represent the removed comments and cause confusion. why that is is kind of technical, but i could probably come up with a solution to it
And when you click on them, you also won't get scrolled to them
Yes!
This has been suggested before, but iirc it's hard to get all the details right. I don't remember the details, though.
This script can be simple, because, as something not officially part of SN, it doesn't have to meet the same quality standards.
For example, with this script, if you happen to click on a link to a reply to someone you've muted, you won't be scrolled to the reply, because the script removes the muted thread (as mentioned by @optimism in #1439671). The "official code" would have uncollapsed the muted thread.
I hope stackers don't run this and then report bugs caused by it to @k00b or @sox 😅
I saw that it's really easy to use without having to bother the SN devs; however, for me, since I use the PWA version most of the time and don't use Brave, it's still out of reach. It's good to know there are good coders like you to count on when I want to suggest something that's not feasible to implement across the entire platform.
Disclaimer: May miss out on dank memes
don’t touch good memes please
Thank you btw!
Fight code With code
the pen is mightier than the sword
I don’t remember the lifecycle of mutation observers, do you need to clean them up somehow?
Mhh, good point, probably, but this runs in the global context, so I guess the browser will clean up for me anyway when you close the tab? haha
I think that’s right in this case. Fun stuff!
Well, it was short-lived fun, my post already disappeared from the front page, haha. Anyway!
Ironically, it's been oblivionzapped by the person that needs your script most.
Op @ek why don't you attach and show attached LN wallets?
Clearly you are capable but maybe you dont believe in verifying you are on board with and maximising your use of and support of LN here on SNs?
Genuinely mystified why you would not attach or deliberately conceal your LN wallet attached status.