https://github.com/brownie-in-motion/hn-adblock Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + GitHub Sponsors + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} brownie-in-motion / hn-adblock Public * Notifications * Fork 0 * Star 2 A Chrome extension that removes "[company] is hiring" ads on https:// news.ycombinator.com/. 2 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Latest commit @brownie-in-motion brownie-in-motion feat: add elaboration in readme ... ae13b1f May 5, 2022 feat: add elaboration in readme ae13b1f Git stats * 2 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time src feat: create chrome extension May 5, 2022 README.md feat: add elaboration in readme May 5, 2022 View code HN Adblock Extension Userscript README.md HN Adblock A Chrome extension that removes "[company] is hiring" ads on https:// news.ycombinator.com/. Note: I do not read the orange site. This was motivated entirely by boredom. Extension To add the extension to Chrome, visit chrome://extensions/ and click "Load unpacked." Then, navigate to and select the src directory of this repository. Userscript For those who aren't on Chrome or don't want to install an extension, the following user script should work instead: // ==UserScript== // @name HN Adblock // @version 1.0 // @match https://news.ycombinator.com/* // @author https://github.com/brownie-in-motion/ // @description Removes ads on https://news.ycombinator.com/ // ==/UserScript== // whether to re-number the posts after the removed ads const FIX_NUMBERING = false; [...(document.querySelector('table.itemList')?.rows ?? [])] .reduce((a, _r, i, rows) => (i % 3 ? a : [...a, rows.slice(i, i + 3)]), []) .filter((row) => row.length === 3) .filter(([title]) => !title.querySelector('td.votelinks')) .forEach((rows) => rows.forEach((row) => row.remove())); if (FIX_NUMBERING) { document .querySelectorAll('span.rank') .forEach?.((s, i) => s.textContent && (s.textContent = `${i + 1}.`)); } This can be used with userscript managers like Greasemonkey or Tampermonkey. About A Chrome extension that removes "[company] is hiring" ads on https:// news.ycombinator.com/. Resources Readme Stars 2 stars Watchers 1 watching Forks 0 forks Releases No releases published Packages 0 No packages published Languages * JavaScript 73.0% * HTML 27.0% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.