pull down to refresh

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

  1. Install a userscript extension like Tampermonkey
  2. Go to the mutenuke page on GreasyFork
  3. 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!

  1. Go to brave://settings/shields/filters
  2. Enable developer mode
  3. 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 });
})
  1. 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.

804 sats \ 1 reply \ @rblb 6h

Before people running this start complaining to @sox and @k00b about the site being slow…

This fires on every DOM mutation (often multiple times per load) and queries the whole document each time. With many live comments and huge threads, this can be a problem.

At the very least, the observer logic should be debounced and only act on newly added nodes.

reply
1 sat \ 0 replies \ @ek OP 3h

Thank you, I will let you know when this becomes a problem

reply
44 sats \ 2 replies \ @adlai 5h

thank you for sharing your code.

I realise one bad side-effect of LLMs is that there's increasing pressure for code to be highly polished before sharing, and thus possibly greater pressure to keep snippets and tweaks private. I'm not familiar with much/any of your work, beyond knowing that you are [were?] one of the main SN devs, so you might be a little immune to that pressure.


I must admit, I do consider the simple implementation a bad idea, or at least, an excessively coarse solution to a granular problem. e.g. when I muted DarthCoin once, I only did temporarily because I was pissed enough that wasting time and energy on useless arguments became a real risk; if I didn't eventually see comments from him when viewing muted comments, I might have forgotten to unmute until someone mentioned him.

reply
101 sats \ 1 reply \ @ek OP 2h
I realise one bad side-effect of LLMs is that there's increasing pressure for code to be highly polished before sharing

I would say the opposite is true: there has never been less shame in publishing bad code. See the PRs of this guy as just one example. I think people feel less responsible for their code now, just because an LLM wrote it for them. Or LLMs attract people with the wrong mindset to start contributing code.

I must admit, I do consider the simple implementation a bad idea, or at least, an excessively coarse solution to a granular problem

It solved my problem. I have muted a lot of stackers, and some of them comment a lot. It's very tempting to click and see who wrote what, similar to what @optimism mentioned in #1439436. I don't think I've ever not regretted clicking on them.

I might have forgotten to unmute until someone mentioned him.

I've been through this. I always end up muting them again. At this point, I don't care about what I might occasionally be missing. It's not worth having a worse user experience overall.

reply
77 sats \ 0 replies \ @optimism 2h
I think people feel less responsible for their code now, just because an LLM wrote it for them.

Less at stake, because just blame the bot. But the avalanche of slop will influence culture the other way around ultimately: there is no longer any reason to deliver buggy code anymore. Get it right or gtfo.

It solved my problem.

Mine too, thank you.

I've been through this, but I always end up muting them again.

Same. This is why I'm okay with this. I don't care if other people interact with those I muted; I don't need to downzap anything but scammers (and sloppy stuff, on my territory, because I said I'd do that)

reply

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.

reply
151 sats \ 4 replies \ @ek OP 23h

I don't need to virtue-signal about lightning, my work speaks for itself

reply

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.

reply

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???

reply
112 sats \ 1 reply \ @Scoresby 13h

Have you considered that many stackers don't bother responding to you because of how you are acting?

reply

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?

reply
597 sats \ 9 replies \ @optimism 23h

Fixes courtesy of:

  • runAfterHydration: GPT, Claude, Gemini and GLM (all said the same, lol)
  • node.style = "visibility: hidden" instead of node.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 });
  });
});
reply
112 sats \ 8 replies \ @ek OP 23h

Ohh, nice fix! Also nice edit within the 10-minute timer, haha

reply
112 sats \ 7 replies \ @optimism 23h

It was the ultimate pressure cooking exercise in javascript debugging because I wrote "verified works" and then I hit post and it died 😂

reply
101 sats \ 6 replies \ @ek OP 23h

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.

reply
101 sats \ 5 replies \ @optimism 23h

confirmed. This why you don't let old people code for the browser 😂

reply
101 sats \ 4 replies \ @ek OP 23h

With node.style = "display: none", you can also keep running it after the slightly faster DOMContentLoaded event and don't need requestAnimationFrame. The load event will also wait until images are loaded.

Thank you!!

reply
101 sats \ 3 replies \ @optimism 23h

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

reply
101 sats \ 2 replies \ @ek OP 22h

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

44 sats \ 9 replies \ @Fenix 21h

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.

reply
144 sats \ 3 replies \ @optimism 21h

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.

reply
101 sats \ 1 reply \ @Fenix 20h

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?

reply
162 sats \ 0 replies \ @k00b 20h

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

reply
70 sats \ 0 replies \ @ek OP 21h

And when you click on them, you also won't get scrolled to them

reply
201 sats \ 3 replies \ @ek OP 21h
Does your script hide the comments from muted users that stay collapsed until you click on them?

Yes!

It could be a toggle in the SN settings

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 😅

reply
101 sats \ 0 replies \ @Fenix 20h

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.

reply

Disclaimer: May miss out on dank memes

reply
1 sat \ 0 replies \ @Fenix 20h

don’t touch good memes please

reply
1 sat \ 0 replies \ @ek OP 20h
the name is really good.

Thank you btw!

reply
111 sats \ 1 reply \ @jakoyoh629 22h

Fight code With code

reply

the pen is mightier than the sword

reply

I don’t remember the lifecycle of mutation observers, do you need to clean them up somehow?

reply
51 sats \ 4 replies \ @ek OP 22 Feb

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

reply

I think that’s right in this case. Fun stuff!

reply
51 sats \ 2 replies \ @ek OP 22 Feb

Well, it was short-lived fun, my post already disappeared from the front page, haha. Anyway!

reply
51 sats \ 0 replies \ @optimism 23h

Ironically, it's been oblivionzapped by the person that needs your script most.

reply

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.

reply