pull down to refresh

I have it slated for testing but I won't run it in production because I don't run extensions outside of the built-in brave "shields" thing. Still it's something I would like to have.

628 sats \ 17 replies \ @ek 22 Feb

I just learned that Shield allows you to run custom scriplets!

So if you save this as a custom scriptlet at brave://settings/shields/filters:

window.addEventListener('DOMContentLoaded', () => {
    function removeCollapsedComments() {
        document.querySelectorAll('div[class*="comment_collapsed"]')
            .forEach(node => {
                if (node.textContent.startsWith("reply from someone you muted")) node.remove()
            }
        )
    }

    // Run on initial page load
    removeCollapsedComments();

    // Watch for dynamically loaded content
    const observer = new MutationObserver(removeCollapsedComments);
    observer.observe(document.body, { childList: true, subtree: true });    
})

and then save this custom filter:

stacker.news##+js(user-stackernews.js)

it also works!

reply

Thank you!!!

reply
191 sats \ 5 replies \ @ek 22 Feb

No worries!!! I hope you can read JavaScript though, because you shouldn't trust me haha

reply

Got myself a second opinion

reply
170 sats \ 3 replies \ @ek 22 Feb

Wow, impressive use of ChatGPT

reply

Huh? Everyone does this.

reply
170 sats \ 1 reply \ @ek 22 Feb

First time I’ve seen someone do that!

reply

It's very useful for when you feel light imposter syndrome and be more certain about your own capabilities.

Is this running on every single site we go to?

reply
201 sats \ 2 replies \ @ek 22 Feb

No, the custom filter scopes it to stacker.news

reply

stacker.news##+js(user-stackernews.js)

This line handles that? Thanks

reply
123 sats \ 0 replies \ @ek 22 Feb

Yes!

reply

only what you specify in the custom filter.

reply

There?

reply

On a new line and the script in the section below it.

reply
it also works!

Confirmed.

reply

This is why we must tag @ek more often - I just got rid of Wildmonkey.

Thanks ek.

reply
101 sats \ 0 replies \ @ek 22 Feb

reply