by FragenAntworten · 4y ago · 0 comments
// ==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();
}
}
}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.
news.ycombinator.com##tr[class="athing comtr"]:has(a[href="user?id=usernamehere"])