Show HN: A chrome extension that fades out old links on HN/Reddit/News sites
chrome.google.com
chrome.google.com
You can fix videos by injecting
// make visited links distinct
injectStyle('.yt-lockup-title a:visited {color: black;}');
injectStyle('#watch7-sidebar .video-list-item a .title {color: #167ac6;}');
injectStyle('#watch7-sidebar .video-list-item a:visited .title {color: #141761;}');
injectStyle('a.yt-uix-sessionlink {color: #167ac6 !important;}');
injectStyle('a.yt-uix-sessionlink:visited {color: #141761 !important;}');
but things like external links and playlists require looping over document.getElementsByClassName("yt-uix-sessionlink"), monitoring DOMNodeInserted, and injecting history.pushState(null, null, 'https://www.youtube.com/watch?v='+videoID) for all the garbage filled YT links (what you get when clicking on playlist video). I pack all of it into my custom tempermonkey script. // ==UserScript==
// @name HN visited link
// @version 1
// @grant all
// ==/UserScript==
let aCss = `
.news-list a:visited {
color: lightgray;
}
`
addGlobalStyle(aCss);
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}Some sites may also just don't see the value of distinguishing visited links from unvisited ones. That's a shame.
Nope. Only Firefox does (as far as I know).
EDIT: Apparently Yandex is built on Chromium and allows installation of Chrome desktop extensions (only in the alpha version though). Maybe that's what author meant: https://play.google.com/store/apps/details?id=com.yandex.bro...
mine will fade out all that have been "seen" (not visited) and in a generic manner so it will work on all sites. I'm not sure yet if automatically or with a button press.
maybe with a button press and only those links that have been visible in the viewport (if performance allows tracking the position of every link)
is yours open source? if love to steal how you save all the links.
https://github.com/guiambros/HNMarkAllRead
For my endavour I guess I should use a DB and never really had to before. For a generic solution I don't wint to push it all in to one big array but split by domain or something.