Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Marking comments as read on HN, the hacky way
// these are to be pasted into the console
// remove by clicking on the up arrow
// the useful thing is that you remove comments and add the removed id to
// an array, so next time you know exactly what you've considered
// (use case might be monthly "Who is hiring?")
function remove(id) {
document.getElementById(id).parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.remove();
}
[].forEach.call(
document.getElementsByTagName("a"),
function(item) {
item.onclick = function(e) {
e.preventDefault();
var ids = localStorage.getItem('ids').split(',');
ids.push(item.id);
localStorage.setItem('ids', ids.toString());
remove(item.id);
}
}
);
localStorage.getItem('ids').split(',').forEach(remove);
@lazywithclass

This comment has been minimized.

Copy link
Owner Author

commented Sep 2, 2015

Bug: comments on comments remain, but I don't really care, for my use case is fine as it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.