Lurker News
Paste the following into the console of any HN page - for annotated avatars on all HN comments. (self contained code)

  for(u of document.querySelectorAll('.hnuser'))for(u.prepend(c=document.createElement('canvas')),x=c.getContext('2d'),c.width=18,c.height=14,s=u.innerText,r=1,i=28+s.length;i--;i<28?r>>>29>X*X/3+Y/2&&x.fillRect(6+2*X,2*Y,2,2)&x.fillRect(6-2*X,2*Y,2,2):r+=s.charCodeAt(i-28,x.fillStyle='#'+(r>>8&0xFFFFFF).toString(16)))r^=r<<13,r^=r>>>17,r^=r<<5,X=i&3,Y=i>>2

Comments (493) 108 threads

Show all comments

Showing thread 9 of 108

SCUSKU6 replies#
Wow this is really great! Noob question, but let's say I wanted to permanently load this JS in my browser? How would I achieve that? Grease monkey? Extension? Thanks :)
freeCandy1 reply#
Should be really easy with grease monkey. I simply pasted the snippet into a new script and enabled it for this site. Works perfectly out of the box.
wizwit9991 reply#
needed to add.

  let c,x,X,Y,r,i,s;
smartsl#
and let u;
throwamon1 reply#
Violentmonkey is a nice open source alternative to Greasemonkey.
chrismorgan1 reply#
Your wording implies Greasemonkey is not open source. I don’t know if that was your intention or not, but Greasemonkey is open source.
j-james#
They're probably confusing it with Tampermonkey, which isn't open source.
sgt#
Or ask pg to save it on the server side.
daptaq1 reply#
I don't know about you, but I really don't want an extension for every small change one might want to apply to one specific site.
mrmuagi#
That's fair how about Tampermonkey -- I use it occasionally to apply js/css/html fixups to sites, e.g. Add browser titles to sites for better bookmarks, re-organize/add site html, etc. I did use it for removing content but ublock origin is much better imo for most cases.