Y Combinator Hacker News Job Posts Adblock

Removes ads on https://news.ycombinator.com/

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Y Combinator Hacker News Job Posts Adblock
// @version     1.4
// @match       https://news.ycombinator.com/*
// @exclude     https://news.ycombinator.com/user*
// @author      Dave121
// @description Removes ads on https://news.ycombinator.com/
// @license     GPLv3
// @icon         https://www.google.com/s2/favicons?sz=64&domain=ycombinator.com
// @namespace   https://greasyfork.org/en/users/102920-dave121
// ==/UserScript==

// do you wish to re-number the posts after the removed ads?
const FIX_NUMBERING = false;

// Select all "athing" rows
const rows = document.querySelectorAll('tr.thing, tr.athing');

// Filter rows that do NOT contain a vote arrow (i.e., job posts)
const filteredRows = [...rows].filter(row => !row.querySelector('td.votelinks'));

// Remove both the "athing" and its subtext row
filteredRows.forEach(row => {
  // remove the main row
  const next = row.nextElementSibling;
  row.remove();

  // remove its detail row (age | hide | comments)
  if (next && !next.classList.contains('athing')) {
    next.remove();
  }
});


if (FIX_NUMBERING) {
  document
    .querySelectorAll('span.rank')
    .forEach?.((s, i) => s.textContent && (s.textContent = `${i + 1}.`));
}