HNewhere: A Userscript for Side-by-Side Hacker News Discussions
HNewhere: A Userscript for Side-by-Side Hacker News Discussions
HNewhere integrates Hacker News discussions directly into articles
HNewhere is a lightweight userscript designed to solve the common workflow friction of opening two separate tabs—one for an article and one for its Hacker News discussion. By automatically detecting matching stories, the script embeds the HN discussion in a resizable sidebar, allowing users to read the content and the community commentary simultaneously.
Core Functionality and Features
HNewhere automates the discovery of discussions by tracking links opened from Hacker News and detecting matching stories on external pages. Its primary features include:
- Integrated Sidebar: Displays HN discussions beside the article content.
- Automatic Detection: Identifies matching Hacker News stories without manual searching.
- UI Customization: Includes a resizable and collapsible sidebar that preserves its width across sessions.
- Direct Navigation: Reply links within the sidebar open directly on the Hacker News website.
Technical Requirements and Installation
The tool is written in 100% JavaScript and operates as a userscript, meaning it requires a browser extension to manage and execute the code.
Installation Steps:
- Install a userscript manager such as Tampermonkey, Violentmonkey, or Userscripts (for Safari).
- Install or paste the
HNewhere.jsscript from the official GitHub repository. - Navigate to any article that has an associated Hacker News discussion.
Dependencies: The script relies on the Hacker News API and the HN Algolia search API to fetch and match discussions to the current URL.
Community Feedback and Technical Considerations
Users on Hacker News have highlighted several practical considerations and potential improvements for the script:
User Experience and Mobile Optimization
Some users noted that the sidebar can be intrusive on smaller screens.
"When I went to this link from the main page, on mobile I had to scroll to the right to see the (-) to minimize because the sidebar was too large... It may make some sense to start minimized so I can read the article first."
Privacy and Data Leakage
Technical critiques pointed out that the script's current implementation may leak browser data to the Algolia API.
"As it is now it leaks browser URLs + query string + fragments to hn.algolia.com since it queries it on every single page you visit."
Alternative Workflows
While many users praised the tool for eliminating "two-tab friction," others suggested that built-in browser features now provide similar utility. Users mentioned using Chrome's split view or Firefox's Split View to achieve side-by-side reading without the need for a third-party script.
Project Availability
HNewhere is open-source and licensed under the MIT License. The source code is available on GitHub under the user twalichiewicz.