Earlier quoted context omitted.
javascript:if (typeof e!=='undefined') e.style.background='#ccc'; e=Array.from(document.querySelectorAll('.age%20a:not(.s)')).sort().at(-1); e.style.background='#ff0';e.classList.add('s'); e.scrollIntoView({behavior:"smooth",block:"center",});{} Looks like the code got mangled in the Twitter post, in particular the curly braces at the end. And the line order, "e=" should be at the beginning logically. javascript:e=Ar…
It is all one line. Yes, Twitter formats it in a way that makes it impossible to copy just the text. Because it thinks that .style is a toplevel domain and #ccc is a hashtag. Here is a repo from which it is easy to copy: https://github.com/no-gravity/hn-bookmarklet
javascript:if (!location.href.match('ycom')) {location.href='https://news.ycombinator.com'};if (typeof e!=='undefined') e.style.background='#c0c0c0';e=Array.from(document.querySelectorAll('.age%20a:not(.seen)')).sort().at(-1);e.style.background='#ff0';e.classList.add('seen');e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"});{}
I see, that {} at the end is intentional, as you described in another comment.And accessing the variable e before assigning it a value, now I see that probably serves a practical purpose too.