HNSpecial.settings.registerModule("accurate_domain_names", function () {
  function editLinks() {
    var titles = _.toArray(document.getElementsByClassName("title"));

    titles.forEach(function (title) {
      if (!title.getAttribute("data-hnspecial-accurate") && title.childElementCount === 2 && title.children[1].classList.contains("comhead")) {
        // Removes http/https, matches the domain name excluding www
        var url = title.children[0].getAttribute("href").replace(/http(?:s)?:\/\/(?:www.)?([a-z0-9.-]+)(?:\/\S*)/i, "$1").toLowerCase();
        var domain = title.children[1];
        domain.textContent = " (" + url + ") ";
        title.setAttribute("data-hnspecial-accurate", "true");
      }
    });
  }

  // Run it
  editLinks();

  // Subscribe to the event emitted when new links are present
  HNSpecial.settings.subscribe("new links", function () {
    editLinks();
  });
});

HNSpecial.settings.registerModule("accurate_domain_names", function () {
  function editLinks() {
    var titles = _.toArray(document.getElementsByClassName("title"));

    titles.forEach(function (title) {
      if (!title.getAttribute("data-hnspecial-accurate") && title.childElementCount === 2 && title.children[1].classList.contains("comhead")) {
        // Removes http/https, matches the domain name excluding www
        var url = title.children[0].getAttribute("href").replace(/http(?:s)?:\/\/(?:www.)?([a-z0-9.-]+)(?:\/\S*)?/i, "$1").toLowerCase();
        var domain = title.children[1];
        domain.textContent = " (" + url + ") ";
        title.setAttribute("data-hnspecial-accurate", "true");
      }
    });
  }

  // Run it
  editLinks();

  // Subscribe to the event emitted when new links are present
  HNSpecial.settings.subscribe("new links", function () {
    editLinks();
  });
});

fix some domains not matching