Hacker News Hide Inline Ads

Hide inline ads/recruitment on Hacker News

  1. // ==UserScript==
  2. // @name Hacker News Hide Inline Ads
  3. // @namespace http://news.ycombinator.com/
  4. // @version 1.0
  5. // @license GPLv3
  6. // @description Hide inline ads/recruitment on Hacker News
  7. // @author xdpirate
  8. // @match https://news.ycombinator.com/
  9. // @match https://news.ycombinator.com/?p*
  10. // @match https://news.ycombinator.com/news*
  11. // @match https://news.ycombinator.com/best*
  12. // @match https://news.ycombinator.com/newest*
  13. // @match https://news.ycombinator.com/front*
  14. // @match https://news.ycombinator.com/ask*
  15. // @match https://news.ycombinator.com/show*
  16. // @icon https://www.google.com/s2/favicons?sz=64&domain=ycombinator.com
  17. // @grant none
  18. // ==/UserScript==
  19. let things = document.querySelectorAll("tr.athing");
  20. for(let i = 0; i < things.length; i++) {
  21. if(things[i].nextSibling.querySelector("td.subtext").childElementCount == 2) {
  22. things[i].style.display = "none";
  23. things[i].nextSibling.style.display = "none";
  24. things[i].nextSibling.nextSibling.nextSibling.style.display = "none";
  25. }
  26. }