Reddit New Comment Highlighting

A free Gold feature

< Feedback on Reddit New Comment Highlighting

Review: OK - script works, but has bugs

§
Posted: 29-04-2022

stopped working on FF

§
Posted: 24-03-2024

It works for me if i change from JQuery to Javascript in the highlight function, like this:

HLN.highlight = function(cutoff) {
    var items = document.getElementsByClassName('entry')
    Array.from(items).forEach(function(element) {
    var time = element.querySelectorAll('time')[0]
        var date = new Date(time.getAttribute('datetime')).getTime();
        if (date > cutoff) {
            element.classList.add('new-comment');
        } else {
            element.classList.remove('new-comment');
        }
    });
};

Post reply

Sign in to post a reply.

长期地址
遇到问题?请前往 GitHub 提 Issues。