Giter Club home page Giter Club logo

hnrelevant's Introduction

preview of the relevant submissions section on hacker news

Chrome Web Store Mozilla Add-on Stars

HNRelevant

A lightweight browser extension that augments your Hacker News experience by showing related submissions to the one you're viewing. It helps you immerse yourself in interesting discussions and uncover overlooked gems.

Features

  • Related submissions ready to be explored
  • Ability to fine-tune the search query and fetch results in place
  • Two modes:
    • Automatic: Enjoy a seamless experience with results generated upon page load
    • Manual: Search only when desired
  • The result blends naturally with Hacker News's interface and match its look and feel
  • Available on Firefox for Android™
  • Manageable preferences via the extension's popup in the browser toolbar

Installation

Available on:

  • Chrome web store: HNRelevant
  • Firefox (Desktop & Android) add-on: HNRelevant
  • As a Userscript. This option also has the benefit of supporting further browsers:
    1. Make sure to have one of the userscripts extensions installed e.g: Tampermonkey, Violentmonkey, or Greasemonkey.
    2. The userscript file can be found here HNRelevant.user.js.
    3. Load the script into the extension of your choice.

How it works

It's based on HN algolia search API and uses the submission title as its initial query

License

Released under the MIT License. See LICENSE file for details.

hnrelevant's People

Contributors

geekodour avatar imdj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hbcbh1999

hnrelevant's Issues

Attach timestamp information for the results

Right now time is displayed in relative format as string eg: 3 years ago, 10 months ago, etc

To improve accessibility and UX we can follow similar structure to Hacker News

<span class="age" title="2024-01-24T18:14:17">
    <a href="item?id=">6 hours ago</a>
</span>

but replace <a> with the more semantically appropriate <time>

Add a tooltip with hints on how to improve search

Add a tooltip to the query customization field with a collection of hints on how to improve the quality of results.

Example:

  1. Remove years and numbers if they're irrelevant
  2. Omit non-essential details to help reduce noise
  3. Choose keywords that capture the essence of the topic

Changing the number of results triggers search in manual mode

Selecting different options from "number of results" dropdown is supposed to regenerate search results for instant feedback. At the moment, in manual mode, the results are fetched even if the user hasn't requested a search already

Expected behavior: Not fetching results in manual mode other than when a user explicitly clicks submit

Avoid running on a comment page

Submissions and comments on Hacker News share the same URL format:

  • Submissions: /item?id=38309611
  • Comments: /item?id=38310213

Right now, the extension relies solely on the manifest's content_scripts key and runs on any page it's allowed on, i.e: pages that matches *://news.ycombinator.com/item*
We have to implement some safety rail to detect submission pages and further limit execution

Small screens support

Consider converting the sidebar to more compact form that integrate better with vertical layout on small screens

Firefox version

This extension is insanely useful. Would love to see a Firefox version, opening this issue to explore the possibility.

Add search type `Verbatim` and `Similar`

  • Verbatim: Literal results using query parameter. More precise, Useful for previous discussions or mentions.
  • Similar: Perform a more generic/exploratory search for related submissions using similarQuery (default)

User preferences

Add persistent preferences with options to:

  1. Manual mode: Disable fetching results automatically on page load (enhancing privacy)
  2. Set default number of results in the sidebar

Use Manifest v3 for Firefox

One hiccup in adapting manifest v3 to Firefox is host_permissions. Chrome and Firefox handle thing differently in this case, Chrome before installation will prompt the user for confirmation to 'Add extension' with a summary of what it can access, while Firefox treats these permissions as opt-in where the user is expected after installation to manually visit the extensions page and grants its permissions [0]

[0] https://blog.mozilla.org/addons/2022/11/17/unified-extensions-button-and-how-to-handle-permissions-in-manifest-v3/

MV3 treats host permissions (listed in the extension manifest) as opt-in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.