

Show HN: A small hack for browsing HN faster (Chrome users) - skidding
https://github.com/skidding/hacker-comments

======
skidding
Hey guys, quick intro.

I was procrastinating heavily these days and reading HN more than usual, and
the listing > article > listing > comments flow started to become kind of
frustrating. I would sometimes go to the comments page and then the external
link from there, just so the BACK action would take me to the comments page.

But this was not ideal for two reasons: 1, if I got to read the top comments
first I'd probably already be biased by the time I got to check out the linked
page (I guess that also says a lot about me); and 2, I don't always want to go
through the comments page at all, but I can't really know this up front,
without visiting the link first.

So, since I never got to make a Chrome extension before and because there's
never a better time to experiment with new stuff than when you're avoiding
'real' work, I tried to create one to fix this. With only a few coding hours
this evening, it already works great for me. Here's the flow:

\- Install the Chrome extension (find link in github README)

\- Click on any link from the HN listing normally

\- If you decide to comment or read comments after visiting the linked page,
press SHIFT+BACKSPACE and it will take you to the comments page on HN

\- But wait, if you do BACK now, it takes you back to that page and you want
to go to the HN listing instead. Do SHIFT+BACKSPACE again then

PS: Let me know if you also find this flow helpful or if you have ideas for
different shortcuts.

PPS: I'm not tracking anything or doing anything malicious with your browser,
but since it's my first extension, let me know if you see any fishy coding
logic in there.

~~~
TobiasFunkeMD
This is pretty cool, it definitely fits into my flow. One thing I noticed
while browsing the code in page.js, I would probably change:

var getCommentUrl = function(anchor) { return
$(anchor).closest('tr').next().find('a:nth-child(3)').prop('href'); };

to

var getCommentUrl = function(anchor) { return
$(anchor).closest('tr').next().find('a[href^="item"]').prop('href'); };

Not that HN will ever change their html...

~~~
skidding
That's a very good idea. It used to be a:last but then it would send me to the
delete page for my posts :)

You can create a pull request if you want, since it's on github, otherwise
I'll definitely change that myself

