News for hackers. Stuff that matters.
Re:Web Highlighter Userscript by kirubakaran on Wednesday December 04, 2024 @03:58PM (#42321988)
Nice! I built something similar for https://histre.com/ and made it even robust that the highlight will stay on even if the rest of the page changes. For example, if you highlight a sentence in Hacker News comments, the position of the comment changes all the time and histre's highlights the correct sentence. I open sourced it here, if that's helpful: https://gitlab.com/histre/browser-extension/-/blob/master/hi...
Re:Web Highlighter Userscript by akomtu on Wednesday December 04, 2024 @10:20PM (#42324550)
Very well done! And only 300 lines of code. I'd suggest adding this:

dot.onclick = () => setTimeout(displayHighlightsPopup, 50);

In addition to that, if possible, your highlighter could show all domains with highlights.

Another useful addition would be sharing a page with someone with your highlights. Even here, on HN, someone could read an article and share a link with highlights added. The highlights themselves could go to the URL #hash part. This could be used together with the Archive.is snapshots.

Edit: A simpler feature would be saving a summary of all highlights in a basic text form that can be easily shared here or anywhere else, really. It's very handy when you're reading a long page, keep highliting interesting parts and at the end get the summary.

Re:Web Highlighter Userscript by 1116574 on Thursday December 05, 2024 @10:00AM (#42328854)
As for sharing - text fragments could also do for a nice addition: https://developer.mozilla.org/en-US/docs/Web/URI/Fragment/Te...