

Chrome extension for hiding articles on HN - bambax
https://chrome.google.com/extensions/detail/dibillbafbngeiloehmhhibhjhipeoig

======
bambax
Although visited links are quite visible on HN, I sometimes end up clicking on
articles I've already read; marking them as "hidden" avoids this (as hidden
articles are non-clicable).

Articles can be "unhidden" ("show" link); hidden articles are remembered
between sessions, for 7 days (since articles move rather rapidly on the front
page there is little point in remembering the status longer -- should maybe be
user-configurable though).

The "option[s]" page has just one option for now -- open links in new window.

~~~
eneveu
Good idea. Thanks for sharing, I'll try it if/when I do switch to Chrome.

I had the same problem, but solved it a little differently:

I'm using Firefox, so I installed the "Stylish" extension, and created the
following style, that colors the visited links:

    
    
      @namespace url(http://www.w3.org/1999/xhtml);
      
      @-moz-document domain("news.ycombinator.com") {
         .title > :visited, .subtext > :visited
            { 
               color: #ff6600! important
            }
      }
    

Then, when browsing HN, I click on all the links, ignoring the orange ones (=
already visited), and bookmark all (and only) the ones I'm interested in. So,
instead of hiding uninteresting content, I save the content that interests me
;)

It used to be a lot faster with the Read It Later extension (Alt + W would
bookmark to a "To Read" folder), but the extension no longers saves the pages
to a bookmark folder, so I stopped using it... (
[http://www.ideashower.com/support/read-it-
later/20-syncing-a...](http://www.ideashower.com/support/read-it-
later/20-syncing-and-bookmarks/) )

I'm still looking for a better workflow to browse HN. Maybe a greasemonkey
script that would bookmark the HN comment link, and save both the comments and
the linked articles to instapaper?

------
Tichy
How does it work? I installed it, but see no difference on HN.

I think it could be useful because as time passes, I end up reading the
uninteresting articles, too. Maybe if I would hide them upon first encounter,
I could avoid that.

~~~
bambax
Once it's installed, if you reload the page you should see a "hide" link below
each article, after the "comments" or "discuss" link.

If you don't see it, it should be either that you're browsing HN on a
different domain than "news.ycombinator.com" (?) or that you're using a
version of Chrome < 5...?

~~~
Tichy
Doesn't seem to work for me (Chrome 5.0.375.99).

~~~
confuzatron
Me neither. I don't know anything about chrome extensions, but I was able to
edit it to show an alert(), and append a div to the body tag, so it is
running. But it doesn't appear to modify the page in any way I can see.

Seems to be that when you have no hide options stored, the request listener
returns {} and the main.js code blows up on "options = JSON.parse(response);"
- (at least it doesnt seem to make it past that line).

This fixes things for me:

    
    
      try {
        options = JSON.parse(response);
      }
        catch(err) {
      }

~~~
bambax
Wow. You're quite the debugger! ;-)

It was indeed the problem (you had to have options before you even used it!)
Fixed it in 0.1.2.

~~~
confuzatron
I have recently got into arsing about with javascript :)

------
_delirium
Excellent, thanks! One of my longest-standing dislikes about the move from
listservs to web-based forums (which otherwise has a lot of positives) is the
much worse support for per-user state: marking things read, deleting things,
watching or ignoring specific threads, getting a list of new (unread) replies
to your own posts, etc. This solves at least the mark-as-read (or as not-
going-to-read) part of it for HN.

------
omellet
Can you make it so I can auto-hide articles from certain sites? For example, I
can't access *.tumblr.com urls from work, so I'd prefer not to even see them.

Edit: actually, just disabling the link might work better.

------
bambax
Update: version 0.2.0 adds 2 options: "autoHide" (hide articles when clicked)
and "collapse" (remove articles from the list instead of blanking them)

~~~
bambax
Version 0.3.0 adds collapsible comments.

------
mike-cardwell
Should have written it as a greasemonkey plugin so it could be used cross
browser.

~~~
bambax
I wrote it for me and I use Chrome; also, it uses localStorage to remember
preferences, which is not available everywhere (I couldn't get it to work with
recent versions of FF for example).

But if there is demand I can try to repackage it as a greasemonkey script
(Chrome extensions are essentially greasemonkey scripts anyway).

~~~
zackattack
You should write a tutorial on making chrome plugins!

~~~
bambax
Chrome online doc isn't bad:
<http://code.google.com/chrome/extensions/getstarted.html>

but some things are not totally obvious so I might compile what I've learned
in a blog post, yes!

