Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: HNRelevant – Show related HN submissions in an integrated sidebar (github.com/imdj)
80 points by imadj on May 28, 2023 | hide | past | favorite | 36 comments
While browsing Hacker News, I wished for an easier way to find related submissions (instead of googling and going back and forth). So I made this small chrome extension that automatically shows relevant submissions on page load. It's intergrated as a sidebar right in the page (for ease & native look), with customization options for fine control.

It's based on HN algolia search API[1] and uses the submission title as its initial query with the ability to customize the query if you're not satisfied with the initial results.

Originally, I took it as an opportunity to try my hands at creating a browser extension, but I was quite satisfied with the result and so I decided to release it.

[1] HN algolia search API: https://hn.algolia.com/api



Is there a specific reason that projects like these seemingly often are Chrome only. I use Firefox and I feel «left out» on a near weekly basis.


Well, speaking for myself, it's just the browser I use, I don't necessarily love it but it the standard browser with the least headache.

As for the extension, it doesn't depend on anything other than hackernews and the search api, so a port should be easy.

Update: It's now available as a userscript, tested on Firefox with Tampermonkey


As a Web Extension dev, I can say that Chrome is definitely the go-to platform for developing new extensions, as you basically target most of the market this way (incl. Chrome, Edge, Brave, etc.). Any additional browser, means ofc additional dev time and testing, some of which can be really funky, like Safari.

That said, from the two (the other one being Safari), Firefox is much easier to port the extension to and there's even webextension-polyfill that gets you >95% of the way there (most of the time).


> That said, from the two (the other one being Safari), Firefox is much easier to port the extension to…

Is it? Has anyone in this thread tried this? (I have not.) https://developer.apple.com/documentation/safariservices/saf...


Yeah, I have done it twice now. Safari doesn't have as good of a support as Firefox for a lot of Web Extension API, and that's on top of various compatibility issues with Safari itself. Not to mention having to deal with Xcode to just bundle the extension into Mac app-like wrapper.

To be more precise the last time I did this I had to: - Adjust cookie SameSite attribute (cookies didn't work properly otherwise) - Migrate back from MV3 to MV2 (Safari DevTools are really bad for MV3 for some reason and there were also other issues that didn't appear in MV2) - Adjust JS and CSS (some newer techniques were simply not supported in Safari)

Firefox didn't have any of those issues. On top of that, there's much more resources available online than there is for Safari - though, to be fair, it's mostly because its support for WebExtensions is newer and there aren't as many extensions for Safari. But, when you do find some resources you have to verify whether they're actually on the most recent standard - Web Extensions - since Safari supported multiple over the years, that have nothing to do with WE, and are very similarly named: Safari Extensions, Safari App Extensions, Safari Web Extensions


Safari also has random weird (read: highly annoying) things where it purports to support a given component of the WebExtensions API, and then totally doesn't. Storage.sync is a perfect example—why I should have to build my own syncing infrastructure purely to support safari (particularly given that apple always talks about wanting to protect user data)?

https://developer.apple.com/documentation/safariservices/saf...


FF is my primary browser too, but with the user base down to 3%, it's not exactly relevant any more.


"3 of 100 people" - I'm one of those three.


I would be willing to bet that the 3% stat doesn't hold true for HN users


Oh … my naive ass thought it was like 50/50 between Chrome and Fx :(


There's a script available now - just installed it in FF with Greasemonkey.


How hard is it to create a cross-browser plug-in?


Trivial


it's <200 js code lines just port it.


Yes, so one could either make the argument of why don’t projects like this «just» do that? Or the other way around.


Cool project! Was thinking about something similar since we tried an embeddings index on HN titles for our demo (hn.curiosity.ai), and was really impressed with the results. If you want I can expose an API for you to use too


Interesting. i just was trying the 'similar stories' and while the list returned was around a certain theme - it didn't have anything to do with the featured article. But I like the implementation in general.


Tres cool. And the query results look pretty relevant/interesting so far.

Is there a way to shrink the sidebar font wrt to the main content font; similar to Chrome Reading List sidebar? I don't see any mechanism in the code to do that. ATM it's (naturally) the same size as the rest of the page which gives the sidebar the same "importance" as the main content.

I'm thinking something simple, like dropping in a CSS snippet, as opposed to a whole framework of different CSS stanzas _a la_ Obsidian.


I think this should have an option only to request the submissions when the user wants it to.

Sending a full history somewhere (in this case hn search) doesn't seem like a great idea


Hm, I didn't take this into consideration

Since I would like it to be more auto-pilot, will probably introduce an option to opt for 'manual' mode for those interested


Update: If anyone is comming here in the future, it's now published on Chrome and Firefox, you can find it under 'HNRelevant':

1. Chrome web store: https://chrome.google.com/webstore/detail/hnrelevant/iajhnke...

2. Firefox add-ons: https://addons.mozilla.org/en-US/firefox/addon/hnrelevant/

Don't forget to leave reviews if you find it useful


dan usually does this manually on hot threads. Really nice to have it as a plugin

thanks for sharing


I'm pretty sure he has said it is an automated process, I can't find the comment now but he did mention that he uses a custom-built interface for moderation that he hopes to release one day.



Cool project! I was thinking about something similar since we played with an embeddings index model on HN titles for our demo at hn.curiosity.ai If you want I could expose an API for you to use on the extension


Please consider replacing the 8mb gif animation with a normal video file. It will both load faster and allow users to pause, start from the beginning etc.


Chrome only it seems.


Yeah, it's just a small quality of life thing that I thought I'd share

It probably doesn't need much tweaking to work on other browsers. Will definitely look into it.


Just an update: It's now available as a userscript for other browsers. Tested on Firefox with Tampermonkey.


Oh nice! Thank you!


in my experience, a ton of chrome extensions (at least MV2 ones) work in FF basically out of the box

it's not necessarily true the other way around, though, because there are some weird things that google chooses not to support (e.g. promises, they require that you use callbacks instead)


Chrome extensions also work on other Chromium based browsers e.g. Edge, Brave, Opera, Vivaldi etc.


Yeah not a big fan of that monoculture.


Awesome! May you release this as an UserScript so we can install it using Violentmonkey/Tampermonkey?


A userscript is available now in the repo here: https://github.com/imdj/HNRelevant/blob/main/HNRelevant.user...

I tested it on Firefox with Tampermonkey, but I'll admit that I'm not that familiar with userscripts extensions, so if you try it, let me know what you think


Thanks for the work! love it! I tried it with violentmonkey, had some issues, small changes fixes it. Made a PR for changes https://github.com/imdj/HNRelevant/pull/4 :)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: