Reddit New Comment Highlighting

A free Gold feature

< Reddit New Comment Highlighting 피드백으로 돌아가기

리뷰: 보통 - 스크립트가 작동하지만 버그 있음

§
게시: 2022-04-29

stopped working on FF

§
게시: 2024-03-24

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');
        }
    });
};

답글 게시

답글을 게시하려면 로그인하세요.

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