https://github.com/mgladdish/website-customisations/tree/main/news.ycombinator.com Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # 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 }} mgladdish / website-customisations Public * Notifications * Fork 0 * Star 19 * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights 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 Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create website-customisations/news.ycombinator.com/ Go to file website-customisations/news.ycombinator.com/ Latest commit @mgladdish @github-actions mgladdish and github-actions[bot] Bump version number ... a9123dd Dec 18, 2022 Bump version number a9123dd Git stats * History Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time . . __tests__ Initially hide the comment box on item pages Dec 18, 2022 docs Manipulate the html to support special quote formatting Dec 17, 2022 README.md Manipulate the html to support special quote formatting Dec 17, 2022 jest.config.json Ignore test resources dir Dec 17, 2022 package-lock.json Attempt to record test stats in ci build Dec 17, 2022 package.json Attempt to record test stats in ci build Dec 17, 2022 tampermonkey.js Bump version number Dec 18, 2022 [ ] news.ycombinator.com Features 'normal' Hacker News homepage With this userscript enabled: 'normal' comments page Comments with this script enabled How to install Gotchas README.md news.ycombinator.com Build status badge for news.ycombinator.com A Tampermonkey script to make reading Hacker News more bearable. This isn't an attempt to make Hacker News into something it isn't, or even fix up the html to make it accessible or play nicely with reader mode. It's just a tweak of the exising site, trying to keep the feel as close to the original as possible whilst fixing the biggest annoyances that make it hard to use and read. Features * Larger fonts so its legible at standard zoom level * Menu bar is full width * Some unnecessary cruft hidden (e.g. numbers next to headings on the homepage) * downvoted comments no longer light gray text and hard to read. Instead: + black text + faint grey background + smaller font size * some custom rending of formatting conventions + Leading > treated as a quote: o text node wrapped in a
o hn orange left border o faint orange background o italicised text 'normal' Hacker News homepage Hacker News homepage before With this userscript enabled: Hacker News homepage after 'normal' comments page Hacker News comments before Comments with this script enabled Hacker News homepage before How to install 1. Install https://www.tampermonkey.net/ 2. Select 'create a new script' from tampermonkey's plugin 3. Paste the raw contents of tampermonkey.js into the editor 4. Save. 5. Open https://news.ycombinator.com in your browser and it should look much better! Gotchas Running tampermonkey scripts without the browser plugin forces a couple of changes on how we write the script. 1. We can't use tampermonkey's built-in functions, e.g. any of the GM_ functions. 2. As we're adding the script to our page after it has loaded, we need a way of triggering it to run. Therefore I've had to pull the script out into a referencable member. When the page loads there's a call to the function, and in the tests we can explicitly call the same function after we've attached it to the dom for it to take effect. Footer (c) 2022 GitHub, Inc. Footer navigation * 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.