4 ms·
Web Highlighter Userscript
- kirubakaran 2y agoNice! I built something similar for https://histre.com/ 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 highlights the correct sentence even with that change. I open sourced it here, if that's helpful: https://gitlab.com/histre/browser-extension/-/blob/master/highlight.js?ref_type=heads https://gitlab.com/histre/browser-extension/-/blob/master/hi...
- akomtu 2y agoVery 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.
- 1116574 2y agoAs for sharing - text fragments could also do for a nice addition: https://developer.mozilla.org/en-US/docs/Web/URI/Fragment/Text_fragments#syntax https://developer.mozilla.org/en-US/docs/Web/URI/Fragment/Te...