GitHub - adamzwasserman/hnreader

3 min read Original article ↗

HN Reader

A Chrome extension to track your Hacker News reading. Hide stories you've seen, collapse comment threads, and get notified when new replies appear.

Features

Story Hiding

On any HN listing page (front page, newest, ask, show, etc.), each story has a checkbox. Check it to dim the story. Useful for marking stories you've already read or don't want to see.

  • Dimmed stories remain visible but faded (35% opacity)
  • Uncheck to restore full visibility
  • State persists across page loads

Comment Accordions

On thread pages, each comment gets a collapse toggle (▶/▼) next to the username.

  • Click ▶ to collapse a comment and all its replies
  • Click ▼ to expand
  • Collapsed state is remembered per comment

New Reply Detection

When you load any thread page, the extension checks collapsed comments for new replies:

  • If a collapsed comment now has replies you haven't seen, it auto-expands
  • A NEW badge appears next to the toggle
  • Orange left border highlights the comment

This only applies to comments you've previously collapsed - the extension remembers which child comments existed when you collapsed it, and compares against the current state.

User Highlighting

The extension auto-detects your HN username (when logged in) and highlights your interactions:

Highlight Meaning
Green border + "you" badge Your comment
Blue border + "replied to you" badge Someone replied to your comment
Purple border + "you replied" badge A comment you replied to

Close Conversations

Don't want to follow up on a reply? Click the × next to "replied to you" to mark it as closed. Closed conversations show a muted "closed" badge instead. Click the badge to reopen.

Management Popup

Click the extension icon to open the management popup:

  • Stats: Hidden stories count, collapsed comments count
  • Storage bar: Visual indicator of storage usage
  • Hidden Stories list: Search and unhide individual stories
  • Export: Download all data as JSON backup
  • Import: Restore from a JSON backup
  • Clear All: Delete all extension data

Installation

Arc / Chrome / Chromium browsers

  1. Go to arc://extensions (or chrome://extensions)
  2. Enable Developer mode (toggle in top right)
  3. Click Load unpacked
  4. Select the hnreader folder

Storage

Data is stored locally in your browser using Chrome's storage API.

  • Limit: 5 MB
  • Auto-cleanup: When storage reaches 90% capacity, the oldest week of data is automatically deleted
  • What's stored: Hidden story IDs/titles, collapsed comment states, your username

Typical usage (~200 bytes per entry) means you can store ~20,000+ items before cleanup triggers.

Files

hnreader/
├── manifest.json    # Extension configuration
├── background.js    # Storage and cleanup logic
├── content.js       # HN page modifications
├── styles.css       # Injected styles
├── popup.html       # Management UI
├── popup.js         # Popup logic
├── popup.css        # Popup styles
└── icons/           # Extension icons

Privacy

  • All data stays in your browser (local storage only)
  • No data is sent to any server
  • No analytics or tracking
  • Username is only detected from the page, not stored externally