Giter Site home page Giter Site logo

imdj / hnrelevant Goto Github PK

View Code? Open in Web Editor NEW
69.0 2.0 1.0 9.52 MB

A browser extension that shows relevant submissions on Hacker News

Home Page: http://hnrelevant.vercel.app/

License: MIT License

JavaScript 79.49% CSS 7.74% HTML 7.19% PowerShell 5.58%
extension chrome-extension firefox-addon hackernews userscript hacker-news browser-extension hn firefox-extension firefox-android

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

Watchers

 avatar  avatar

Forkers

hbcbh1999

hnrelevant's Issues

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.

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)

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

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

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>

Firefox version

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

Small screens support

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

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

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.