3 ms·
I've made userscript that locally stores hashes of titles and comments that stays in viewport for some time period and adds some marker to those displayed for t
by myfonj 5y ago
I've made userscript that locally stores hashes of titles and comments that stays in viewport for some time period and adds some marker to those displayed for the first time (i.e. guaranteed to be "unread" for the browser profile, provided there was no edit).
https://greasyfork.org/en/scripts/423969-hn-style-unread-content/code https://greasyfork.org/en/scripts/423969-hn-style-unread-con...
It uses IntersectionObserver for "exposition watch" and "crypto.subtle.digest" for SHA-1 hashes - I was pleasantly surprised those native APIs are enough to get this magic working.
It's very POC-ey (absolutely no checks for storage capacity etc) but works quite well for me.
E: Actual markers are just light green right borders on "unread" items that slightly fades out after "exposition timeout". I'm using dark userstyle for HN (https://uso.kkx.one/style/71155 https://uso.kkx.one/style/71155 ); in default theme they are probably too light to be visible.