3 ms·
A particular user left many low-signal comments on this post, which was distracting, so I wrote a small userscript to remove the comments of arbitrary users. S
by FragenAntworten 5y ago
A particular user left many low-signal comments on this post, which was distracting, so I wrote a small userscript to remove the comments of arbitrary users. Sharing here in case anyone else finds it useful.
// ==UserScript==
// @name Mute users
// @namespace Violentmonkey Scripts
// @match https://news.ycombinator.com/item
// @grant none
// @version 1.0
// @author -
// @description 12/18/2021, 9:43:19 AM
// ==/UserScript==
const mutedUsers = ['usernamehere']; // <== CHANGE THIS
window.addEventListener('DOMContentLoaded', mute);
function mute() {
for (const mutedUser of mutedUsers) {
const result = document.evaluate(`//*[@class="hnuser" and text()="${mutedUser}"]/ancestor::*[contains(@class, "comtr")]`, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE);
for (let i = 0; i < result.snapshotLength; i++) {
const el = result.snapshotItem(i);
el.remove();
}
}
}
- Tomte 5y agoUsers don't seem to flag those comments, even the two-words-in-uppercase comments. Most of those are still live, even ten hours later. This isn't a "wait a bit and things will be fine" situation. Flagging and voting has always been controversial on HN, but when it doesn't work at all even with those — I have no idea how it could work with slightly controversial political stuff.
- fdgdd 5y agoAnd here's the uBlock Origin version: news.ycombinator.com##tr[class="athing comtr"]:has(a[href="user?id=usernamehere"])