How to hide 'N comments' links on the Hacker News homepage

Note that even with this time and sanity-saving solution, you can still read the comments for a particular story by clicking through the link to the story submitter and then their most recent submission.

In Firefox, install Greasemonkey; in Chrome, install Tampermonkey or the open-source violentmonkey.

Create a new user script and paste in

// ==UserScript==
// @name        Hacker News: hide comments links
// @namespace   hidehncommentslinks
// @include     *://news.ycombinator.com/
// @include     *://news.ycombinator.com/news*
// @include     *://www.hntoplinks.com/*
// @version     1
// @grant       none
// ==/UserScript==

Array.from(document.querySelectorAll("a[href]")).map(e => {
    if(/^https?:\/\/news\.ycombinator\.com\/item\?id=\d+$/.test(e.href)) {
        if(/^(\d+\s+comments?|discuss)$/.test(e.textContent.trim())) {
            e.style.display = 'none';
        // The 'N minutes ago' links also point to the comments, but the time
        // itself is useful, so just remove the href.
        } else if(/^\d+\s+(second|minute|hour|day)s?\s+ago$/.test(e.textContent)) {
            e.href = '#';
        }
    }
});

Hacker News should now appear like this:

Hacker News without the comments links