News for hackers. Stuff that matters.
Re:Show HN: A chrome extension that fades out old links on H... by rasz on Thursday August 16, 2018 @04:28AM (#17772928)
I hate it soo much. Pervasive spying doesnt help either. YT for example loves to generate custom redirects for all offsite links posted in video description/comments :(.

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.

There are no comments on this comment yet.