Hacker News new | ask | show | jobs
by kkoncevicius 1570 days ago
Thanks! This works with one exception - when two links in a row are from the same domain only the first one is removed.

I don't know any javascript, but this is my attempt at modification:

    let domains = "twitter\.com|\
                   cnn.com\
                  ";

    (function(){
        'use strict';
        var links = document.getElementsByClassName("titlelink");
        var owners = [];
        for (var link of links) {
            if (link.href.match(domains)) {
                owners.push(link.closest(".athing"));
            }
        }
        for (var owner of owners) {
            owner.nextSibling.remove();
            owner.remove();
        }
    })();